mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-08 23:18:18 -07:00
working on schedules
This commit is contained in:
parent
72418edd7c
commit
2fb55a7443
26 changed files with 726 additions and 1 deletions
18
db/migrate/20170306145359_create_schedules.rb
Normal file
18
db/migrate/20170306145359_create_schedules.rb
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
class CreateSchedules < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :schedules do |t|
|
||||
t.references :school, foreign_key: true
|
||||
t.string :name
|
||||
t.text :description
|
||||
t.integer :frequency_hours
|
||||
t.date :start_date
|
||||
t.date :end_date
|
||||
t.boolean :active, default: true
|
||||
t.boolean :random, default: false
|
||||
t.integer :recipient_list_id
|
||||
t.integer :question_list_id
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
19
db/schema.rb
19
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: 20170305155018) do
|
||||
ActiveRecord::Schema.define(version: 20170306145359) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
|
@ -77,6 +77,22 @@ ActiveRecord::Schema.define(version: 20170305155018) do
|
|||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "schedules", force: :cascade do |t|
|
||||
t.integer "school_id"
|
||||
t.string "name"
|
||||
t.text "description"
|
||||
t.integer "frequency_hours"
|
||||
t.date "start_date"
|
||||
t.date "end_date"
|
||||
t.boolean "active", default: true
|
||||
t.boolean "random", default: false
|
||||
t.integer "recipient_list_id"
|
||||
t.integer "question_list_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["school_id"], name: "index_schedules_on_school_id", using: :btree
|
||||
end
|
||||
|
||||
create_table "schools", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.integer "district_id"
|
||||
|
|
@ -102,4 +118,5 @@ ActiveRecord::Schema.define(version: 20170305155018) do
|
|||
end
|
||||
|
||||
add_foreign_key "recipient_lists", "schools"
|
||||
add_foreign_key "schedules", "schools"
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue