Add circle editor

This commit is contained in:
KMY 2023-08-21 16:37:35 +09:00
parent c97e63bb18
commit b0854b1dd8
33 changed files with 1671 additions and 31 deletions

View file

@ -0,0 +1,21 @@
# frozen_string_literal: true
class CreateCircles < ActiveRecord::Migration[7.0]
def change
create_table :circles do |t|
t.belongs_to :account, null: false, foreign_key: { on_delete: :cascade }
t.string :title, null: false, default: ''
t.datetime :created_at, null: false
t.datetime :updated_at, null: false
end
create_table :circle_accounts do |t|
t.belongs_to :circle, null: true, foreign_key: { on_delete: :cascade }
t.belongs_to :account, null: false, foreign_key: { on_delete: :cascade }
t.belongs_to :follow, null: false, foreign_key: { on_delete: :cascade }
t.datetime :created_at, null: false
t.datetime :updated_at, null: false
end
add_index :circle_accounts, [:circle_id, :account_id], unique: true
end
end