about summary refs log tree commit diff stats
path: root/db
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-07-03 13:58:57 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-07-03 14:01:41 -0400
commit8e15dbd73035c2a2198a2828a20ddcebe0739823 (patch)
treef93ada8d2c3c06e8cf1908bf5b0e22b1b54dd956 /db
parent49b11f2864f75bcfb8d0d01439939ed68aa90b8f (diff)
downloadthoughts-8e15dbd73035c2a2198a2828a20ddcebe0739823.tar.gz
thoughts-8e15dbd73035c2a2198a2828a20ddcebe0739823.tar.bz2
thoughts-8e15dbd73035c2a2198a2828a20ddcebe0739823.zip
Implemented streams
Currently there are no links to the pages for editing stream updates, and the admin panel for managing streams could probably have a better look & feel, but here's some basic working functionality.

refs #8
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20180702220722_create_streams.rb11
-rw-r--r--db/migrate/20180702221133_create_updates.rb10
-rw-r--r--db/schema.rb19
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 @@
1class 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
11end
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 @@
1class 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
10end
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
13ActiveRecord::Schema.define(version: 20180702214240) do 13ActiveRecord::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"
256end 273end