--up
CREATE TABLE short_urls (
    id integer GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    "short_code" text NOT NULL UNIQUE,
    "long_url" text NOT NULL,
    "created_at" timestamp NOT NULL DEFAULT NOW()
);

CREATE TABLE short_url_clicks (
    "short_url_id" integer REFERENCES short_urls(id),
    "created_at" timestamp NOT NULL DEFAULT NOW()
);

--down

DROP TABLE short_url_clicks;
DROP TABLE short_urls;
