SQL

CREATE TABLE "cookbooks_to_categories"  (
  cookbook_id CHAR(32),
  category_id CHAR(32),
  CONSTRAINT cookbook_id_category_id_key UNIQUE (cookbook_id, category_id),
  FOREIGN KEY(category_id) REFERENCES categories (id),
  FOREIGN KEY(cookbook_id) REFERENCES cookbooks (id)
)

+ Add column

Columns

Column Data type Allow null Primary key Actions
cookbook_id CHAR(32) Rename | Drop
category_id CHAR(32) Rename | Drop

Foreign Keys

Column Destination
cookbook_id cookbooks.id
category_id categories.id

+ Add index

Indexes

Name Columns Unique SQL Drop?
ix_cookbooks_to_categories_category_id category_id SQL
CREATE INDEX ix_cookbooks_to_categories_category_id
ON cookbooks_to_categories (category_id)
Drop
ix_cookbooks_to_categories_cookbook_id cookbook_id SQL
CREATE INDEX ix_cookbooks_to_categories_cookbook_id
ON cookbooks_to_categories (cookbook_id)
Drop
sqlite_autoindex_cookbooks_to_categories_1
  • cookbook_id
  • category_id
SQL
-- no sql found --
Drop