28 lines
545 B
TypeScript
28 lines
545 B
TypeScript
import { cassandra } from "@lib/cassandra";
|
|
|
|
async function createTable() {
|
|
const client = cassandra.getClient();
|
|
|
|
await client.execute(`
|
|
CREATE TABLE IF NOT EXISTS guild_invites (
|
|
invite_code TEXT PRIMARY KEY,
|
|
guild_id TEXT,
|
|
created_by TEXT,
|
|
created_at TIMESTAMP,
|
|
expires_at TIMESTAMP,
|
|
max_uses INT,
|
|
uses INT,
|
|
is_revoked BOOLEAN
|
|
);
|
|
`);
|
|
}
|
|
|
|
async function dropTable() {
|
|
const client = cassandra.getClient();
|
|
|
|
await client.execute(`
|
|
DROP TABLE IF EXISTS guild_invites;
|
|
`);
|
|
}
|
|
|
|
export { createTable, dropTable };
|