sarting to generalize profiles

This commit is contained in:
2023-01-16 00:17:22 +02:00
parent 485c0475b7
commit 4ffc6e3c85
26 changed files with 165 additions and 207 deletions

View File

@ -0,0 +1,17 @@
class CreateProfiles < ActiveRecord::Migration[7.0]
def change
create_table :profiles do |t|
t.string :name , null: false
t.string :kind , null: false
t.text :bio , null: false
t.string :picture , null: false
t.references :member, null: false, foreign_key: true
t.timestamps
end
remove_column :members, :name, :string
remove_column :members, :bio, :text
remove_column :members, :picture, :string
remove_column :members, :public, :boolean
end
end

View File

@ -1,12 +0,0 @@
class CreateTeachers < ActiveRecord::Migration[7.0]
def change
create_table :teachers do |t|
t.string :name , null: false
t.text :bio , null: false
t.string :picture , null: false
t.references :member, null: false, foreign_key: true
t.timestamps
end
end
end

11
db/schema.rb generated
View File

@ -37,10 +37,6 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_15_120517) do
end
create_table "members", force: :cascade do |t|
t.string "name"
t.string "bio"
t.string "picture"
t.boolean "public"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "email", default: "", null: false
@ -56,14 +52,15 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_15_120517) do
t.index ["reset_password_token"], name: "index_members_on_reset_password_token", unique: true
end
create_table "teachers", force: :cascade do |t|
create_table "profiles", force: :cascade do |t|
t.string "name", null: false
t.string "kind", null: false
t.text "bio", null: false
t.string "picture", null: false
t.bigint "member_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["member_id"], name: "index_teachers_on_member_id"
t.index ["member_id"], name: "index_profiles_on_member_id"
end
create_table "thredded_categories", force: :cascade do |t|
@ -298,7 +295,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_15_120517) do
end
add_foreign_key "entities", "members"
add_foreign_key "teachers", "members"
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
add_foreign_key "thredded_user_post_notifications", "members", column: "user_id", on_delete: :cascade