mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
Add timestamps to all SQM models
This commit is contained in:
parent
7461377066
commit
37f13716e8
6 changed files with 61 additions and 1 deletions
10
db/migrate/20211102125207_add_timestamps_to_measures.rb
Normal file
10
db/migrate/20211102125207_add_timestamps_to_measures.rb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
class AddTimestampsToMeasures < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
now = Time.zone.now
|
||||
change_table :measures do |t|
|
||||
t.timestamps default: now
|
||||
end
|
||||
change_column_default :measures, :created_at, from: now, to: nil
|
||||
change_column_default :measures, :updated_at, from: now, to: nil
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
class AddTimestampsToSqmCategories < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
now = Time.zone.now
|
||||
change_table :sqm_categories do |t|
|
||||
t.timestamps default: now
|
||||
end
|
||||
change_column_default :sqm_categories, :created_at, from: now, to: nil
|
||||
change_column_default :sqm_categories, :updated_at, from: now, to: nil
|
||||
end
|
||||
end
|
||||
10
db/migrate/20211102130232_add_timestamps_to_subcategories.rb
Normal file
10
db/migrate/20211102130232_add_timestamps_to_subcategories.rb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
class AddTimestampsToSubcategories < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
now = Time.zone.now
|
||||
change_table :subcategories do |t|
|
||||
t.timestamps default: now
|
||||
end
|
||||
change_column_default :subcategories, :created_at, from: now, to: nil
|
||||
change_column_default :subcategories, :updated_at, from: now, to: nil
|
||||
end
|
||||
end
|
||||
10
db/migrate/20211102130250_add_timestamps_to_survey_items.rb
Normal file
10
db/migrate/20211102130250_add_timestamps_to_survey_items.rb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
class AddTimestampsToSurveyItems < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
now = Time.zone.now
|
||||
change_table :survey_items do |t|
|
||||
t.timestamps default: now
|
||||
end
|
||||
change_column_default :survey_items, :created_at, from: now, to: nil
|
||||
change_column_default :survey_items, :updated_at, from: now, to: nil
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
class AddTimestampsToSurveyItemResponses < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
now = Time.zone.now
|
||||
change_table :survey_item_responses do |t|
|
||||
t.timestamps default: now
|
||||
end
|
||||
change_column_default :survey_item_responses, :created_at, from: now, to: nil
|
||||
change_column_default :survey_item_responses, :updated_at, from: now, to: nil
|
||||
end
|
||||
end
|
||||
12
db/schema.rb
12
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: 2021_10_29_195454) do
|
||||
ActiveRecord::Schema.define(version: 2021_11_02_130307) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
|
@ -80,6 +80,8 @@ ActiveRecord::Schema.define(version: 2021_10_29_195454) do
|
|||
t.float "ideal_low_benchmark"
|
||||
t.integer "subcategory_id", null: false
|
||||
t.text "description"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.index ["measure_id"], name: "index_measures_on_measure_id"
|
||||
t.index ["subcategory_id"], name: "index_measures_on_subcategory_id"
|
||||
end
|
||||
|
|
@ -217,6 +219,8 @@ ActiveRecord::Schema.define(version: 2021_10_29_195454) do
|
|||
t.text "description"
|
||||
t.string "slug"
|
||||
t.integer "sort_index"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.index ["slug"], name: "index_sqm_categories_on_slug", unique: true
|
||||
end
|
||||
|
||||
|
|
@ -236,6 +240,8 @@ ActiveRecord::Schema.define(version: 2021_10_29_195454) do
|
|||
t.string "name"
|
||||
t.integer "sqm_category_id"
|
||||
t.text "description"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
end
|
||||
|
||||
create_table "survey_item_responses", id: :serial, force: :cascade do |t|
|
||||
|
|
@ -244,6 +250,8 @@ ActiveRecord::Schema.define(version: 2021_10_29_195454) do
|
|||
t.integer "survey_item_id", null: false
|
||||
t.string "response_id", null: false
|
||||
t.integer "academic_year_id", null: false
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.index ["academic_year_id"], name: "index_survey_item_responses_on_academic_year_id"
|
||||
t.index ["response_id"], name: "index_survey_item_responses_on_response_id"
|
||||
t.index ["school_id"], name: "index_survey_item_responses_on_school_id"
|
||||
|
|
@ -254,6 +262,8 @@ ActiveRecord::Schema.define(version: 2021_10_29_195454) do
|
|||
t.integer "measure_id", null: false
|
||||
t.string "survey_item_id", null: false
|
||||
t.string "prompt"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.index ["measure_id"], name: "index_survey_items_on_measure_id"
|
||||
t.index ["survey_item_id"], name: "index_survey_items_on_survey_item_id"
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue