main pico / sql / migrations / 20230310_add_aliases_table.sql
Eric Bower  ·  2023-03-12
 1CREATE TABLE IF NOT EXISTS post_aliases (
 2  id uuid NOT NULL DEFAULT uuid_generate_v4(),
 3  post_id uuid NOT NULL,
 4  slug character varying(255) NOT NULL,
 5  created_at timestamp without time zone NOT NULL DEFAULT NOW(),
 6  CONSTRAINT post_aliases_pkey PRIMARY KEY (id),
 7  CONSTRAINT fk_post_aliases_posts
 8    FOREIGN KEY(post_id)
 9  REFERENCES posts(id)
10  ON DELETE CASCADE
11  ON UPDATE CASCADE
12);