Add id to join table

main
Alpha Chen 1 year ago
parent d7dc025af6
commit 7c94fa0587
Signed by: alpha
SSH Key Fingerprint: SHA256:3fOT8fiYQG/aK9ntivV3Bqtg8AYQ7q4nV6ZgihOA20g

@ -19,5 +19,8 @@ Sequel.migration do
entity_id = DB[:entities].insert(created_at:, modified_at:) entity_id = DB[:entities].insert(created_at:, modified_at:)
DB[:pinboard].insert(entity_id:, json: , created_at:, modified_at:) DB[:pinboard].insert(entity_id:, json: , created_at:, modified_at:)
end end
# Remove duplicate entry
DB[:pinboard].where(id: 5001).delete
end end
end end

@ -10,6 +10,7 @@ Sequel.migration do
end end
create_table(:entities_tags) do create_table(:entities_tags) do
primary_key :id
foreign_key :entity_id, :entities, null: false foreign_key :entity_id, :entities, null: false
foreign_key :tag_id, :tags, null: false foreign_key :tag_id, :tags, null: false

Loading…
Cancel
Save