From ad80c40944743515a45d70014e8d5ffb88cd74fc Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 25 Jun 2017 00:00:28 -0400 Subject: Started designing index page --- db/migrate/20170624183854_create_records.rb | 10 +++++++++ db/migrate/20170625004938_create_entries.rb | 12 ++++++++++ db/schema.rb | 34 +++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 db/migrate/20170624183854_create_records.rb create mode 100644 db/migrate/20170625004938_create_entries.rb create mode 100644 db/schema.rb (limited to 'db') diff --git a/db/migrate/20170624183854_create_records.rb b/db/migrate/20170624183854_create_records.rb new file mode 100644 index 0000000..d407e15 --- /dev/null +++ b/db/migrate/20170624183854_create_records.rb @@ -0,0 +1,10 @@ +class CreateRecords < ActiveRecord::Migration[5.1] + def change + create_table :records do |t| + t.text :description + t.references :recordable, polymorphic: true, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20170625004938_create_entries.rb b/db/migrate/20170625004938_create_entries.rb new file mode 100644 index 0000000..0fb85b2 --- /dev/null +++ b/db/migrate/20170625004938_create_entries.rb @@ -0,0 +1,12 @@ +class CreateEntries < ActiveRecord::Migration[5.1] + def change + create_table :entries do |t| + t.string :title + t.text :body + t.string :slug, null: false + t.string :type, null: false + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 0000000..6eca6ad --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,34 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20170625004938) do + + create_table "entries", force: :cascade do |t| + t.string "title" + t.text "body" + t.string "directory", null: false + t.string "slug", null: false + t.string "type", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "records", force: :cascade do |t| + t.text "description" + t.string "recordable_type" + t.integer "recordable_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["recordable_type", "recordable_id"], name: "index_records_on_recordable_type_and_recordable_id" + end + +end -- cgit 1.4.1