diff options
Diffstat (limited to 'db/migrate/20190909045845_create_project_pages_metadata.rb')
-rw-r--r-- | db/migrate/20190909045845_create_project_pages_metadata.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/db/migrate/20190909045845_create_project_pages_metadata.rb b/db/migrate/20190909045845_create_project_pages_metadata.rb new file mode 100644 index 00000000000..5fc8fc6e6c1 --- /dev/null +++ b/db/migrate/20190909045845_create_project_pages_metadata.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class CreateProjectPagesMetadata < ActiveRecord::Migration[5.2] + DOWNTIME = false + + def change + create_table :project_pages_metadata, id: false do |t| + t.references :project, null: false, index: { unique: true }, foreign_key: { on_delete: :cascade } + t.boolean :deployed, null: false, default: false + + t.index :project_id, name: 'index_project_pages_metadata_on_project_id_and_deployed_is_true', where: "deployed = TRUE" + end + end +end |