diff options
| author | ilotterytea <iltsu@alright.party> | 2025-07-02 15:24:16 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-07-02 15:24:16 +0500 |
| commit | 4206dd79626773b3f667e9af0ca007aa35a7c6f3 (patch) | |
| tree | beda52cd5b7e42ddc67042b4cfc0e1ef7510380a /migrations | |
| parent | 6c002985fddc923f57774c0ca5e7ddd36c629fdc (diff) | |
feat: lua storage
Diffstat (limited to 'migrations')
| -rw-r--r-- | migrations/2025-07-02T10-01-06_luastorage/down.sql | 3 | ||||
| -rw-r--r-- | migrations/2025-07-02T10-01-06_luastorage/up.sql | 18 |
2 files changed, 21 insertions, 0 deletions
diff --git a/migrations/2025-07-02T10-01-06_luastorage/down.sql b/migrations/2025-07-02T10-01-06_luastorage/down.sql new file mode 100644 index 0000000..4711155 --- /dev/null +++ b/migrations/2025-07-02T10-01-06_luastorage/down.sql @@ -0,0 +1,3 @@ +-- This file should undo anything in 'up.sql' +DROP TABLE lua_user_storage; +DROP TABLE lua_channel_storage;
\ No newline at end of file diff --git a/migrations/2025-07-02T10-01-06_luastorage/up.sql b/migrations/2025-07-02T10-01-06_luastorage/up.sql new file mode 100644 index 0000000..dd61116 --- /dev/null +++ b/migrations/2025-07-02T10-01-06_luastorage/up.sql @@ -0,0 +1,18 @@ +-- Your SQL goes here +CREATE TABLE IF NOT EXISTS lua_channel_storage( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + channel_id INTEGER NOT NULL REFERENCES channels(id) ON DELETE CASCADE, + lua_id TEXT NOT NULL, + value TEXT NOT NULL DEFAULT '', + + CONSTRAINT unique_lua_script_per_channel UNIQUE (channel_id, lua_id) +); + +CREATE TABLE IF NOT EXISTS lua_user_storage( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, + lua_id TEXT NOT NULL, + value TEXT NOT NULL DEFAULT '', + + CONSTRAINT unique_lua_script_per_channel UNIQUE (user_id, lua_id) +);
\ No newline at end of file |
