aboutsummaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20201009025353_add_default_to_resource_feature.rb30
-rw-r--r--db/migrate/20201009061548_rename_resources_sections_to_classifications.rb5
2 files changed, 35 insertions, 0 deletions
diff --git a/db/migrate/20201009025353_add_default_to_resource_feature.rb b/db/migrate/20201009025353_add_default_to_resource_feature.rb
new file mode 100644
index 0000000..06cad6c
--- /dev/null
+++ b/db/migrate/20201009025353_add_default_to_resource_feature.rb
@@ -0,0 +1,30 @@
+class AddDefaultToResourceFeature < ActiveRecord::Migration[6.0]
+ def up
+ change_column_default :resources, :feature,
+ {
+ "geometry": {
+ "type": "Point",
+ "coordinates": [0,0]
+ },
+ "properties": {
+ "name":"",
+ "description":"",
+ "address":"",
+ "postal_code":"",
+ "city":"",
+ "email":"",
+ "phone_number":"",
+ "website":"",
+ "categories":[],
+ "source":"incommon",
+ "entry_number":nil,
+ "srid":4326
+ }
+ }
+ add_index :resources, :feature, using: :gin
+ end
+ def down
+ change_column_default :resources, :feature, nil
+ remove_index :resources, :feature
+ end
+end
diff --git a/db/migrate/20201009061548_rename_resources_sections_to_classifications.rb b/db/migrate/20201009061548_rename_resources_sections_to_classifications.rb
new file mode 100644
index 0000000..4f7972b
--- /dev/null
+++ b/db/migrate/20201009061548_rename_resources_sections_to_classifications.rb
@@ -0,0 +1,5 @@
+class RenameResourcesSectionsToClassifications < ActiveRecord::Migration[6.0]
+ def change
+ rename_table :resources_sections, :classifications
+ end
+end