starting with events, tied to profiles (not accounts)
This commit is contained in:
14
db/migrate/20230116120518_create_events.rb
Normal file
14
db/migrate/20230116120518_create_events.rb
Normal file
@ -0,0 +1,14 @@
|
||||
class CreateEvents < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
create_table :events do |t|
|
||||
t.string :name , null: false
|
||||
t.text :text , null: false
|
||||
t.date :start_date , null: false
|
||||
t.date :end_date
|
||||
t.references :profile, null: false, foreign_key: true
|
||||
t.string :picture , null: false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
15
db/schema.rb
generated
15
db/schema.rb
generated
@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_01_15_120517) do
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_01_16_120518) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
@ -24,6 +24,18 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_15_120517) do
|
||||
t.index ["member_id"], name: "index_entities_on_member_id"
|
||||
end
|
||||
|
||||
create_table "events", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.text "text", null: false
|
||||
t.date "start_date", null: false
|
||||
t.date "end_date"
|
||||
t.bigint "profile_id", null: false
|
||||
t.string "picture", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["profile_id"], name: "index_events_on_profile_id"
|
||||
end
|
||||
|
||||
create_table "friendly_id_slugs", force: :cascade do |t|
|
||||
t.string "slug", null: false
|
||||
t.integer "sluggable_id", null: false
|
||||
@ -295,6 +307,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_15_120517) do
|
||||
end
|
||||
|
||||
add_foreign_key "entities", "members"
|
||||
add_foreign_key "events", "profiles"
|
||||
add_foreign_key "profiles", "members"
|
||||
add_foreign_key "thredded_messageboard_users", "thredded_messageboards", on_delete: :cascade
|
||||
add_foreign_key "thredded_messageboard_users", "thredded_user_details", on_delete: :cascade
|
||||
|
Reference in New Issue
Block a user