Skip to content

Commit

Permalink
faff.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinmera committed Jan 12, 2025
1 parent 829dae0 commit 4947068
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lib/sql/create_channels_table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE IF NOT EXISTS "lichat-channels"(
"id" INT GENERATED ALWAYS AS IDENTITY,
"name" VARCHAR(32) NOT NULL,
"registrant" INT NOT NULL,
"lifetime" INT NOT NULL,
"expiry" INT NOT NULL,
PRIMARY KEY("id"),
UNIQUE("name")
);

10 changes: 10 additions & 0 deletions lib/sql/create_connections_table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE IF NOT EXISTS "lichat-connections"(
"id" INT GENERATED ALWAYS AS IDENTITY,
"ip" VARCHAR(39) NOT NULL,
"ssl" BOOLEAN NOT NULL,
"user" INT NOT NULL,
"last-update" BIGINT NOT NULL,
"started-on" BIGINT NOT NULL,
PRIMARY KEY("id"),
CONSTRAINT "user" FOREIGN KEY("user") REFERENCES "lichat-users"("id") ON DELETE CASCADE
);
7 changes: 7 additions & 0 deletions lib/sql/create_users_table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE TABLE IF NOT EXISTS "lichat-users"(
"id" INT GENERATED ALWAYS AS IDENTITY,
"name" VARCHAR(32),
"registered" BOOLEAN NOT NULL,
PRIMARY KEY("id"),
UNIQUE("name")
);
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ defmodule Lichat.MixProject do
{:mime, "~> 1.2"},
{:ex_unicode, "~> 1.0"},
{:postgrex, "~> 0.15.8"},
{:yesql, "~> 1.0.1"},
{:ayesql, "~> 1.1"},
{:image, "~> 0.37"},
{:observer_cli, "~> 1.7"}
]
Expand Down

0 comments on commit 4947068

Please sign in to comment.