here come the tags

This commit is contained in:
Roscoe 2025-09-10 03:46:23 +01:00
commit 29368bfdb9
Signed by: RoscoeDaWah
SSH key fingerprint: SHA256:Hqn452XQ1ETzUt/FthJu6+OFkS4NBxCv5VQSEvuk7CE
16 changed files with 155 additions and 2 deletions

View file

@ -0,0 +1,9 @@
class CreateTags < ActiveRecord::Migration[8.0]
def change
create_table :tags do |t|
t.string :name
t.timestamps
end
end
end

View file

@ -0,0 +1,10 @@
class CreateTagToClips < ActiveRecord::Migration[8.0]
def change
create_table :tag_to_clips do |t|
t.references :clip, null: false, foreign_key: true
t.references :tag, null: false, foreign_key: true
t.timestamps
end
end
end

19
db/schema.rb generated
View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.0].define(version: 2025_09_09_013509) do
ActiveRecord::Schema[8.0].define(version: 2025_09_10_022600) do
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
@ -62,6 +62,21 @@ ActiveRecord::Schema[8.0].define(version: 2025_09_09_013509) do
t.index ["user_id"], name: "index_sessions_on_user_id"
end
create_table "tag_to_clips", force: :cascade do |t|
t.integer "clip_id", null: false
t.integer "tag_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["clip_id"], name: "index_tag_to_clips_on_clip_id"
t.index ["tag_id"], name: "index_tag_to_clips_on_tag_id"
end
create_table "tags", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "users", force: :cascade do |t|
t.string "email_address", null: false
t.string "password_digest", null: false
@ -74,4 +89,6 @@ ActiveRecord::Schema[8.0].define(version: 2025_09_09_013509) do
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
add_foreign_key "clips", "categories"
add_foreign_key "sessions", "users"
add_foreign_key "tag_to_clips", "clips"
add_foreign_key "tag_to_clips", "tags"
end