43 lines
605 B
PHP
43 lines
605 B
PHP
<?php
|
|
|
|
include "config.php";
|
|
|
|
$query = "
|
|
CREATE TABLE data (
|
|
id SERIAL PRIMARY KEY,
|
|
text TEXT NOT NULL,
|
|
cw TEXT,
|
|
iscwed BOOLEAN NOT NULL,
|
|
time TIMESTAMPTZ NOT NULL,
|
|
ispublic BOOLEAN NOT NULL,
|
|
isrespondedto BOOLEAN NOT NULL,
|
|
responsetext TEXT,
|
|
responsetime TIMESTAMPTZ,
|
|
isprivread BOOLEAN
|
|
);
|
|
";
|
|
|
|
pg_query($db, $query);
|
|
|
|
$query = "
|
|
CREATE TABLE migrations (
|
|
id TEXT NOT NULL
|
|
);
|
|
";
|
|
|
|
pg_query($db, $query);
|
|
|
|
$query = "
|
|
CREATE TABLE emoji (
|
|
name TEXT NOT NULL PRIMARY KEY,
|
|
url TEXT NOT NULL
|
|
);
|
|
";
|
|
|
|
pg_query($db, $query);
|
|
|
|
include "admin/migrate.php";
|
|
|
|
echo "database set up";
|
|
|
|
?>
|