-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86b473c
commit 3d36319
Showing
2 changed files
with
46 additions
and
73 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
personal/db/migrate/20231231182200_gutentag_tables.gutentag.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
# This migration comes from gutentag (originally 1) | ||
class GutentagTables < ActiveRecord::Migration[7.1] | ||
def change | ||
create_table :gutentag_tags, id: :uuid do |t| | ||
t.string :name, null: false, index: {unique: true} | ||
t.bigint :taggings_count, null: false, index: true, default: 0 | ||
t.timestamps null: false | ||
end | ||
|
||
create_table :gutentag_taggings, id: :uuid do |t| | ||
t.references :tag, null: false, type: :uuid, index: true, foreign_key: {to_table: :gutentag_tags} | ||
t.references :taggable, null: false, type: :uuid, index: true, polymorphic: true | ||
t.timestamps null: false | ||
end | ||
add_index :gutentag_taggings, [:taggable_type, :taggable_id, :tag_id], unique: true, name: "gutentag_taggings_uniqueness" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters