Archived
1
0
This repository has been archived on 2025-01-25. You can view files and clone it, but cannot push or open issues or pull requests.
2021-02-04 15:07:55 +01:00

29 lines
495 B
SQL

-- Your SQL goes here
CREATE TABLE users
(
id INTEGER PRIMARY KEY NOT NULL,
username VARCHAR NOT NULL,
email VARCHAR NOT NULL,
password VARCHAR NOT NULL,
UNIQUE(username, email)
);
CREATE TABLE links
(
id INTEGER PRIMARY KEY NOT NULL,
title VARCHAR NOT NULL,
target VARCHAR NOT NULL,
code VARCHAR NOT NULL,
author INT NOT NULL,
created_at TIMESTAMP NOT NULL,
FOREIGN KEY
(author)
REFERENCES users
(id),
UNIQUE
(code)
);