mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 15:16:55 +08:00
FEATURE: Support backup uploads/downloads directly to/from S3.
This commit is contained in:

committed by
Guo Xiang Tan

parent
5039a6c3f1
commit
c29a4dddc1
33
db/migrate/20180916195601_migrate_s3_backup_site_settings.rb
Normal file
33
db/migrate/20180916195601_migrate_s3_backup_site_settings.rb
Normal file
@ -0,0 +1,33 @@
|
||||
class MigrateS3BackupSiteSettings < ActiveRecord::Migration[5.2]
|
||||
def up
|
||||
execute <<~SQL
|
||||
UPDATE site_settings
|
||||
SET name = 'backup_location',
|
||||
data_type = 7,
|
||||
value = 's3'
|
||||
WHERE name = 'enable_s3_backups' AND value = 't';
|
||||
SQL
|
||||
|
||||
execute <<~SQL
|
||||
DELETE
|
||||
FROM site_settings
|
||||
WHERE name = 'enable_s3_backups';
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
execute <<~SQL
|
||||
UPDATE site_settings
|
||||
SET name = 'enable_s3_backups',
|
||||
data_type = 5,
|
||||
value = 't'
|
||||
WHERE name = 'backup_location' AND value = 's3';
|
||||
SQL
|
||||
|
||||
execute <<~SQL
|
||||
DELETE
|
||||
FROM site_settings
|
||||
WHERE name = 'backup_location';
|
||||
SQL
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user