SQL

CREATE TABLE recipe_share_tokens  (
  created_at DATETIME,
  update_at DATETIME,
  id CHAR(32) NOT NULL,
  group_id CHAR(32) NOT NULL,
  recipe_id CHAR(32) NOT NULL,
  expires_at DATETIME NOT NULL,
  PRIMARY KEY (id),
  FOREIGN KEY(group_id) REFERENCES groups (id),
  FOREIGN KEY(recipe_id) REFERENCES recipes (id)
)

+ Add column

Columns

Column Data type Allow null Primary key Actions
created_at DATETIME Rename | Drop
update_at DATETIME Rename | Drop
id CHAR(32) Rename | Drop
group_id CHAR(32) Rename | Drop
recipe_id CHAR(32) Rename | Drop
expires_at DATETIME Rename | Drop

Foreign Keys

Column Destination
recipe_id recipes.id
group_id groups.id

+ Add index

Indexes

Name Columns Unique SQL Drop?
ix_recipe_share_tokens_created_at created_at SQL
CREATE INDEX ix_recipe_share_tokens_created_at
ON recipe_share_tokens (created_at)
Drop
ix_recipe_share_tokens_group_id group_id SQL
CREATE INDEX ix_recipe_share_tokens_group_id
ON recipe_share_tokens (group_id)
Drop
ix_recipe_share_tokens_recipe_id recipe_id SQL
CREATE INDEX ix_recipe_share_tokens_recipe_id
ON recipe_share_tokens (recipe_id)
Drop
sqlite_autoindex_recipe_share_tokens_1 id SQL
-- no sql found --
Drop