mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
Add timestamps to academic years table
This commit is contained in:
parent
bc27e5a0e8
commit
a613f6cb93
2 changed files with 13 additions and 1 deletions
10
db/migrate/20220503180142_add_timestamps_to_academic_year.rb
Normal file
10
db/migrate/20220503180142_add_timestamps_to_academic_year.rb
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
class AddTimestampsToAcademicYear < ActiveRecord::Migration[7.0]
|
||||||
|
def change
|
||||||
|
now = Time.zone.now
|
||||||
|
change_table :academic_years do |t|
|
||||||
|
t.timestamps default: now
|
||||||
|
end
|
||||||
|
change_column_default :academic_years, :created_at, from: now, to: nil
|
||||||
|
change_column_default :academic_years, :updated_at, from: now, to: nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -10,13 +10,15 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema[7.0].define(version: 2022_04_05_174019) do
|
ActiveRecord::Schema[7.0].define(version: 2022_05_03_180142) do
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "pg_stat_statements"
|
enable_extension "pg_stat_statements"
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
|
||||||
create_table "academic_years", id: :serial, force: :cascade do |t|
|
create_table "academic_years", id: :serial, force: :cascade do |t|
|
||||||
t.string "range", null: false
|
t.string "range", null: false
|
||||||
|
t.datetime "created_at", null: false
|
||||||
|
t.datetime "updated_at", null: false
|
||||||
t.index ["range"], name: "index_academic_years_on_range", unique: true
|
t.index ["range"], name: "index_academic_years_on_range", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue