diff options
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrate/20180702220722_create_streams.rb | 11 | ||||
| -rw-r--r-- | db/migrate/20180702221133_create_updates.rb | 10 | ||||
| -rw-r--r-- | db/schema.rb | 19 |
3 files changed, 39 insertions, 1 deletions
| diff --git a/db/migrate/20180702220722_create_streams.rb b/db/migrate/20180702220722_create_streams.rb new file mode 100644 index 0000000..bb8255e --- /dev/null +++ b/db/migrate/20180702220722_create_streams.rb | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | class CreateStreams < ActiveRecord::Migration[5.1] | ||
| 2 | def change | ||
| 3 | create_table :streams do |t| | ||
| 4 | t.string :title | ||
| 5 | t.text :body | ||
| 6 | t.string :slug | ||
| 7 | |||
| 8 | t.timestamps | ||
| 9 | end | ||
| 10 | end | ||
| 11 | end | ||
| diff --git a/db/migrate/20180702221133_create_updates.rb b/db/migrate/20180702221133_create_updates.rb new file mode 100644 index 0000000..05cc35a --- /dev/null +++ b/db/migrate/20180702221133_create_updates.rb | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | class CreateUpdates < ActiveRecord::Migration[5.1] | ||
| 2 | def change | ||
| 3 | create_table :updates do |t| | ||
| 4 | t.references :stream, foreign_key: true | ||
| 5 | t.text :body | ||
| 6 | |||
| 7 | t.timestamps | ||
| 8 | end | ||
| 9 | end | ||
| 10 | end | ||
| diff --git a/db/schema.rb b/db/schema.rb index e036b75..2ca0b58 100644 --- a/db/schema.rb +++ b/db/schema.rb | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | # | 10 | # |
| 11 | # It's strongly recommended that you check this file into your version control system. | 11 | # It's strongly recommended that you check this file into your version control system. |
| 12 | 12 | ||
| 13 | ActiveRecord::Schema.define(version: 20180702214240) do | 13 | ActiveRecord::Schema.define(version: 20180702221133) do |
| 14 | 14 | ||
| 15 | create_table "blogs", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin" do |t| | 15 | create_table "blogs", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin" do |t| |
| 16 | t.string "title" | 16 | t.string "title" |
| @@ -228,6 +228,22 @@ ActiveRecord::Schema.define(version: 20180702214240) do | |||
| 228 | t.index ["recordable_type", "recordable_id"], name: "index_records_on_recordable_type_and_recordable_id" | 228 | t.index ["recordable_type", "recordable_id"], name: "index_records_on_recordable_type_and_recordable_id" |
| 229 | end | 229 | end |
| 230 | 230 | ||
| 231 | create_table "streams", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| | ||
| 232 | t.string "title" | ||
| 233 | t.text "body" | ||
| 234 | t.string "slug" | ||
| 235 | t.datetime "created_at", null: false | ||
| 236 | t.datetime "updated_at", null: false | ||
| 237 | end | ||
| 238 | |||
| 239 | create_table "updates", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| | ||
| 240 | t.bigint "stream_id" | ||
| 241 | t.text "body" | ||
| 242 | t.datetime "created_at", null: false | ||
| 243 | t.datetime "updated_at", null: false | ||
| 244 | t.index ["stream_id"], name: "index_updates_on_stream_id" | ||
| 245 | end | ||
| 246 | |||
| 231 | create_table "users", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin" do |t| | 247 | create_table "users", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin" do |t| |
| 232 | t.string "login", default: "", null: false | 248 | t.string "login", default: "", null: false |
| 233 | t.string "email", default: "", null: false | 249 | t.string "email", default: "", null: false |
| @@ -253,4 +269,5 @@ ActiveRecord::Schema.define(version: 20180702214240) do | |||
| 253 | add_foreign_key "pokeviewer_pokedex_entries", "pokeviewer_trainers", column: "trainer_id" | 269 | add_foreign_key "pokeviewer_pokedex_entries", "pokeviewer_trainers", column: "trainer_id" |
| 254 | add_foreign_key "pokeviewer_pokemon", "pokeviewer_revisions", column: "current_id" | 270 | add_foreign_key "pokeviewer_pokemon", "pokeviewer_revisions", column: "current_id" |
| 255 | add_foreign_key "pokeviewer_revisions", "pokeviewer_species", column: "species_id" | 271 | add_foreign_key "pokeviewer_revisions", "pokeviewer_species", column: "species_id" |
| 272 | add_foreign_key "updates", "streams" | ||
| 256 | end | 273 | end |
