mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-14 00:07:05 +00:00
c09532864d
* feat(core): create error kind enum * feat(core): add error kind for postgres * feat(core): add error kind for sqlite * feat(core): add error kind for mysql * test(postgres): add error tests * test(sqlite): add error tests * test(mysql): add error tests * fix(tests): fix tests rebasing * refac(errors): add `ErrorKind::Other` variant
24 lines
680 B
SQL
24 lines
680 B
SQL
-- https://github.com/prisma/database-schema-examples/tree/master/postgres/basic-twitter#basic-twitter
|
|
CREATE TABLE tweet
|
|
(
|
|
id BIGINT PRIMARY KEY AUTO_INCREMENT,
|
|
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
|
text TEXT NOT NULL,
|
|
owner_id BIGINT
|
|
);
|
|
|
|
CREATE TABLE tweet_reply
|
|
(
|
|
id BIGINT PRIMARY KEY AUTO_INCREMENT,
|
|
tweet_id BIGINT NOT NULL,
|
|
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
|
text TEXT NOT NULL,
|
|
owner_id BIGINT,
|
|
CONSTRAINT tweet_id_fk FOREIGN KEY (tweet_id) REFERENCES tweet(id)
|
|
);
|
|
|
|
CREATE TABLE products (
|
|
product_no INTEGER,
|
|
name TEXT,
|
|
price NUMERIC CHECK (price > 0)
|
|
);
|