Skip to content

Commit

Permalink
Add not null to room name
Browse files Browse the repository at this point in the history
  • Loading branch information
hmlON committed Jul 23, 2017
1 parent 410627f commit 4389acb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
9 changes: 9 additions & 0 deletions db/migrate/20170720192353_add_not_null_to_room_name.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class AddNotNullToRoomName < ActiveRecord::Migration[5.0]
def up
change_column :rooms, :name, :string, null: false
end

def down
change_column :rooms, :name, :string
end
end
16 changes: 14 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20170719182252) do
ActiveRecord::Schema.define(version: 20170720192353) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand All @@ -31,6 +31,16 @@
t.index ["user_id"], name: "index_activities_on_user_id", using: :btree
end

create_table "invites", force: :cascade do |t|
t.integer "user_id"
t.integer "room_id"
t.string "token"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["room_id"], name: "index_invites_on_room_id", using: :btree
t.index ["user_id"], name: "index_invites_on_user_id", using: :btree
end

create_table "room_actions", force: :cascade do |t|
t.integer "room_id"
t.integer "action_id"
Expand All @@ -55,7 +65,7 @@
end

create_table "rooms", force: :cascade do |t|
t.string "name"
t.string "name", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
Expand Down Expand Up @@ -95,6 +105,8 @@

add_foreign_key "activities", "room_activities"
add_foreign_key "activities", "users"
add_foreign_key "invites", "rooms"
add_foreign_key "invites", "users"
add_foreign_key "room_actions", "actions"
add_foreign_key "room_actions", "rooms"
add_foreign_key "room_activities", "rooms"
Expand Down
3 changes: 0 additions & 3 deletions db/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
Action::DEFAULT_ACTIONS.each do |action_name|
Action.create(name: action_name)
end

0 comments on commit 4389acb

Please sign in to comment.