From d4a6873545c35d01054b860cf603f92c15f9ebe0 Mon Sep 17 00:00:00 2001 From: Meg Crenshaw Date: Fri, 20 May 2022 09:23:18 -0500 Subject: [PATCH 1/8] Generate migration to add data guide model --- .../db/migrate/20220520023757_create_data_guides.rb | 10 ++++++++++ dashboard/db/schema.rb | 12 +++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 dashboard/db/migrate/20220520023757_create_data_guides.rb diff --git a/dashboard/db/migrate/20220520023757_create_data_guides.rb b/dashboard/db/migrate/20220520023757_create_data_guides.rb new file mode 100644 index 0000000000000..84a4eabb62787 --- /dev/null +++ b/dashboard/db/migrate/20220520023757_create_data_guides.rb @@ -0,0 +1,10 @@ +class CreateDataGuides < ActiveRecord::Migration[6.0] + def change + create_table :data_guides do |t| + t.string :key, null: false, index: {unique: true} + t.string :name, index: true + t.text :content + t.timestamps + end + end +end diff --git a/dashboard/db/schema.rb b/dashboard/db/schema.rb index b846c430c9cb8..2e10074fe4495 100644 --- a/dashboard/db/schema.rb +++ b/dashboard/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_04_21_224748) do +ActiveRecord::Schema.define(version: 2022_05_20_023757) do create_table "activities", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t| t.integer "user_id" @@ -457,6 +457,16 @@ t.index ["name"], name: "index_courses_on_name" end + create_table "data_guides", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci", force: :cascade do |t| + t.string "key", null: false + t.string "name" + t.text "content" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["key"], name: "index_data_guides_on_key", unique: true + t.index ["name"], name: "index_data_guides_on_name" + end + create_table "donor_schools", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t| t.string "name" t.string "nces_id" From 5fd5d27e56f930672d818a5f0c2e1e6708957af0 Mon Sep 17 00:00:00 2001 From: Meg Crenshaw Date: Fri, 20 May 2022 09:24:19 -0500 Subject: [PATCH 2/8] Add model file with annotations --- dashboard/app/models/data_guide.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 dashboard/app/models/data_guide.rb diff --git a/dashboard/app/models/data_guide.rb b/dashboard/app/models/data_guide.rb new file mode 100644 index 0000000000000..1bd16a628c2f7 --- /dev/null +++ b/dashboard/app/models/data_guide.rb @@ -0,0 +1,18 @@ +# == Schema Information +# +# Table name: data_guides +# +# id :bigint not null, primary key +# key :string(255) not null +# name :string(255) +# content :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# +# Indexes +# +# index_data_guides_on_key (key) UNIQUE +# index_data_guides_on_name (name) +# +class DataGuide < ApplicationRecord +end From 03b2430375159cdb4dd890910937f34f0adb9102 Mon Sep 17 00:00:00 2001 From: Meg Crenshaw Date: Wed, 25 May 2022 13:13:43 -0500 Subject: [PATCH 3/8] Revert "Add model file with annotations" This reverts commit 5fd5d27e56f930672d818a5f0c2e1e6708957af0. --- dashboard/app/models/data_guide.rb | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 dashboard/app/models/data_guide.rb diff --git a/dashboard/app/models/data_guide.rb b/dashboard/app/models/data_guide.rb deleted file mode 100644 index 1bd16a628c2f7..0000000000000 --- a/dashboard/app/models/data_guide.rb +++ /dev/null @@ -1,18 +0,0 @@ -# == Schema Information -# -# Table name: data_guides -# -# id :bigint not null, primary key -# key :string(255) not null -# name :string(255) -# content :text(65535) -# created_at :datetime not null -# updated_at :datetime not null -# -# Indexes -# -# index_data_guides_on_key (key) UNIQUE -# index_data_guides_on_name (name) -# -class DataGuide < ApplicationRecord -end From 113b74aa1e0aec7906f34373208a0fe636fddfd8 Mon Sep 17 00:00:00 2001 From: Meg Crenshaw Date: Wed, 25 May 2022 13:14:05 -0500 Subject: [PATCH 4/8] Revert "Generate migration to add data guide model" This reverts commit d4a6873545c35d01054b860cf603f92c15f9ebe0. --- .../db/migrate/20220520023757_create_data_guides.rb | 10 ---------- dashboard/db/schema.rb | 12 +----------- 2 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 dashboard/db/migrate/20220520023757_create_data_guides.rb diff --git a/dashboard/db/migrate/20220520023757_create_data_guides.rb b/dashboard/db/migrate/20220520023757_create_data_guides.rb deleted file mode 100644 index 84a4eabb62787..0000000000000 --- a/dashboard/db/migrate/20220520023757_create_data_guides.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateDataGuides < ActiveRecord::Migration[6.0] - def change - create_table :data_guides do |t| - t.string :key, null: false, index: {unique: true} - t.string :name, index: true - t.text :content - t.timestamps - end - end -end diff --git a/dashboard/db/schema.rb b/dashboard/db/schema.rb index 2e10074fe4495..b846c430c9cb8 100644 --- a/dashboard/db/schema.rb +++ b/dashboard/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_05_20_023757) do +ActiveRecord::Schema.define(version: 2022_04_21_224748) do create_table "activities", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t| t.integer "user_id" @@ -457,16 +457,6 @@ t.index ["name"], name: "index_courses_on_name" end - create_table "data_guides", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci", force: :cascade do |t| - t.string "key", null: false - t.string "name" - t.text "content" - t.datetime "created_at", precision: 6, null: false - t.datetime "updated_at", precision: 6, null: false - t.index ["key"], name: "index_data_guides_on_key", unique: true - t.index ["name"], name: "index_data_guides_on_name" - end - create_table "donor_schools", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t| t.string "name" t.string "nces_id" From 125c727791f36222ac5e3fe21a27b11b02125123 Mon Sep 17 00:00:00 2001 From: Meg Crenshaw Date: Wed, 25 May 2022 13:22:57 -0500 Subject: [PATCH 5/8] Add migration to create data docs --- .../db/migrate/20220525181706_create_data_docs.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 dashboard/db/migrate/20220525181706_create_data_docs.rb diff --git a/dashboard/db/migrate/20220525181706_create_data_docs.rb b/dashboard/db/migrate/20220525181706_create_data_docs.rb new file mode 100644 index 0000000000000..6c79bec8116cc --- /dev/null +++ b/dashboard/db/migrate/20220525181706_create_data_docs.rb @@ -0,0 +1,10 @@ +class CreateDataDocs < ActiveRecord::Migration[6.0] + def change + create_table :data_docs do |t| + t.string :key, null: false, index: {unique: true} + t.string :name, index: true + t.text :content + t.timestamps + end + end +end From 93579bbb2a0135f9c898d52caa5eda1b3d5476b8 Mon Sep 17 00:00:00 2001 From: Meg Crenshaw Date: Wed, 25 May 2022 13:24:08 -0500 Subject: [PATCH 6/8] Update annotations and schema file --- dashboard/app/models/data_doc.rb | 18 ++++++++++++++++++ dashboard/db/schema.rb | 12 +++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 dashboard/app/models/data_doc.rb diff --git a/dashboard/app/models/data_doc.rb b/dashboard/app/models/data_doc.rb new file mode 100644 index 0000000000000..d3d880a886004 --- /dev/null +++ b/dashboard/app/models/data_doc.rb @@ -0,0 +1,18 @@ +# == Schema Information +# +# Table name: data_docs +# +# id :bigint not null, primary key +# key :string(255) not null +# name :string(255) +# content :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# +# Indexes +# +# index_data_docs_on_key (key) UNIQUE +# index_data_docs_on_name (name) +# +class DataDoc < ApplicationRecord +end diff --git a/dashboard/db/schema.rb b/dashboard/db/schema.rb index b846c430c9cb8..6f51582e9e4da 100644 --- a/dashboard/db/schema.rb +++ b/dashboard/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_04_21_224748) do +ActiveRecord::Schema.define(version: 2022_05_25_181706) do create_table "activities", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t| t.integer "user_id" @@ -457,6 +457,16 @@ t.index ["name"], name: "index_courses_on_name" end + create_table "data_docs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci", force: :cascade do |t| + t.string "key", null: false + t.string "name" + t.text "content" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["key"], name: "index_data_docs_on_key", unique: true + t.index ["name"], name: "index_data_docs_on_name" + end + create_table "donor_schools", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t| t.string "name" t.string "nces_id" From 59a55500681e39efcbe7b448e42deb16b66c9483 Mon Sep 17 00:00:00 2001 From: Meg Crenshaw Date: Thu, 26 May 2022 10:41:38 -0500 Subject: [PATCH 7/8] Update schema with different collation --- dashboard/db/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/db/schema.rb b/dashboard/db/schema.rb index 6f51582e9e4da..5a43dc3764d5d 100644 --- a/dashboard/db/schema.rb +++ b/dashboard/db/schema.rb @@ -457,7 +457,7 @@ t.index ["name"], name: "index_courses_on_name" end - create_table "data_docs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci", force: :cascade do |t| + create_table "data_docs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t| t.string "key", null: false t.string "name" t.text "content" From a480db19a2219f1f296d916a2b42de72628d10dd Mon Sep 17 00:00:00 2001 From: Meg Crenshaw Date: Tue, 31 May 2022 10:07:11 -0500 Subject: [PATCH 8/8] Update schema file after migration --- dashboard/db/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/db/schema.rb b/dashboard/db/schema.rb index 3b1e514021e5d..7061b27bd6db1 100644 --- a/dashboard/db/schema.rb +++ b/dashboard/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_05_25_181706) do +ActiveRecord::Schema.define(version: 2022_05_25_230111) do create_table "activities", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t| t.integer "user_id"