forked from lavina/lavina
Compare commits
4 Commits
0d53175b5d
...
38fe8ba539
Author | SHA1 | Date |
---|---|---|
Mikhail | 38fe8ba539 | |
Mikhail | d347af4bae | |
Mikhail | b122987a17 | |
Mikhail | d7bb8121e8 |
|
@ -2,3 +2,4 @@
|
||||||
/db.sqlite
|
/db.sqlite
|
||||||
.idea/
|
.idea/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
certs/
|
||||||
|
|
|
@ -3,32 +3,27 @@ repos:
|
||||||
rev: v4.5.0
|
rev: v4.5.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-toml
|
- id: check-toml
|
||||||
- id: check-vcs-permalinks
|
- id: end-of-file-fixer
|
||||||
# - id: end-of-file-fixer
|
|
||||||
- id: fix-byte-order-marker
|
- id: fix-byte-order-marker
|
||||||
- id: mixed-line-ending
|
- id: mixed-line-ending
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
|
|
||||||
# - repo: https://github.com/tconbeer/sqlfmt
|
- repo: local
|
||||||
# rev: v0.18.0
|
|
||||||
# hooks:
|
|
||||||
# - id: sqlfmt
|
|
||||||
# language_version: python
|
|
||||||
|
|
||||||
- repo: https://github.com/sqlfluff/sqlfluff
|
|
||||||
rev: 3.0.3
|
|
||||||
hooks:
|
hooks:
|
||||||
- id: sqlfluff-lint
|
- id: fmt
|
||||||
- id: sqlfluff-fix
|
name: fmt
|
||||||
|
description: Format
|
||||||
|
entry: cargo fmt
|
||||||
|
language: system
|
||||||
|
args:
|
||||||
|
- --all
|
||||||
|
types: [ rust ]
|
||||||
|
pass_filenames: false
|
||||||
|
|
||||||
# - repo: https://github.com/pre-commit/mirrors-prettier
|
- id: check
|
||||||
# rev: "v3.1.0"
|
name: check
|
||||||
# hooks:
|
description: Check
|
||||||
# - id: prettier
|
entry: cargo check
|
||||||
# types_or: [ sql ]
|
language: system
|
||||||
|
types: [ rust ]
|
||||||
# - repo: https://github.com/doublify/pre-commit-rust
|
pass_filenames: false
|
||||||
# rev: master
|
|
||||||
# hooks:
|
|
||||||
# - id: fmt
|
|
||||||
# args: ['--verbose', '--edition', '2018', '--']
|
|
||||||
|
|
23
.sqlfluff
23
.sqlfluff
|
@ -1,23 +0,0 @@
|
||||||
[sqlfluff]
|
|
||||||
dialect = sqlite
|
|
||||||
# exclude_rules = L016,L031,L034
|
|
||||||
|
|
||||||
[sqlfluff:indentation]
|
|
||||||
tab_space_size = 4
|
|
||||||
allow_implicit_indents = True
|
|
||||||
|
|
||||||
[sqlfluff:rules:capitalisation.keywords]
|
|
||||||
# Keywords Capitalization
|
|
||||||
capitalisation_policy = upper
|
|
||||||
|
|
||||||
[sqlfluff:rules:capitalisation.functions]
|
|
||||||
# Function Name Capitalization
|
|
||||||
extended_capitalisation_policy = upper
|
|
||||||
|
|
||||||
[sqlfluff:rules:capitalisation.literals]
|
|
||||||
# Null & Boolean Literals
|
|
||||||
capitalisation_policy = upper
|
|
||||||
|
|
||||||
[sqlfluff:rules:capitalisation.types]
|
|
||||||
# Data Type Capitalization
|
|
||||||
extended_capitalisation_policy = upper
|
|
|
@ -1,27 +1,29 @@
|
||||||
CREATE TABLE users (
|
CREATE TABLE users
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
(
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||||
name STRING UNIQUE NOT NULL
|
name STRING UNIQUE NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
-- for development only, replace with properly hashed passwords later
|
-- for development only, replace with properly hashed passwords later
|
||||||
CREATE TABLE challenges_plain_password
|
CREATE TABLE challenges_plain_password
|
||||||
(
|
(
|
||||||
user_id INTEGER PRIMARY KEY NOT NULL,
|
user_id INTEGER PRIMARY KEY NOT NULL,
|
||||||
password STRING NOT NULL
|
password STRING NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE rooms
|
CREATE TABLE rooms
|
||||||
(
|
(
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||||
name STRING UNIQUE NOT NULL,
|
name STRING UNIQUE NOT NULL,
|
||||||
topic STRING NOT NULL,
|
topic STRING NOT NULL,
|
||||||
message_count INTEGER NOT NULL DEFAULT 0
|
message_count INTEGER NOT NULL DEFAULT 0
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE messages (
|
CREATE TABLE messages
|
||||||
|
(
|
||||||
room_id INTEGER NOT NULL,
|
room_id INTEGER NOT NULL,
|
||||||
id INTEGER NOT NULL, -- unique per room, sequential in one room
|
id INTEGER NOT NULL, -- unique per room, sequential in one room
|
||||||
content STRING NOT NULL,
|
content STRING NOT NULL,
|
||||||
PRIMARY KEY (room_id, id)
|
PRIMARY KEY (room_id, id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -29,6 +31,6 @@ CREATE TABLE memberships
|
||||||
(
|
(
|
||||||
user_id INTEGER NOT NULL,
|
user_id INTEGER NOT NULL,
|
||||||
room_id INTEGER NOT NULL,
|
room_id INTEGER NOT NULL,
|
||||||
status INTEGER NOT NULL, -- 0 for not-joined, 1 for joined, 2 for banned
|
status INTEGER NOT NULL, -- 0 for not-joined, 1 for joined, 2 for banned
|
||||||
PRIMARY KEY (user_id, room_id)
|
PRIMARY KEY (user_id, room_id)
|
||||||
);
|
);
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
ALTER TABLE messages ADD author_id INTEGER NULL REFERENCES users (id); -- noqa: PRS
|
ALTER TABLE messages
|
||||||
|
ADD author_id INTEGER NULL REFERENCES users (id);
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
-- Add migration script here
|
|
Loading…
Reference in New Issue