MCPcopy Create free account
hub / github.com/vastsa/FileCodeBox / create_file_codes_table

Function create_file_codes_table

apps/base/migrations/migrations_001.py:4–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2
3
4async def create_file_codes_table():
5 conn = connections.get("default")
6 await conn.execute_script(
7 """
8 CREATE TABLE IF NOT EXISTS filecodes
9 (
10 id INTEGER not null
11 primary key autoincrement,
12 code VARCHAR(255) not null
13 unique,
14 prefix VARCHAR(255) default '' not null,
15 suffix VARCHAR(255) default '' not null,
16 uuid_file_name VARCHAR(255),
17 file_path VARCHAR(255),
18 size INT default 0 not null,
19 text TEXT,
20 expired_at TIMESTAMP,
21 expired_count INT default 0 not null,
22 used_count INT default 0 not null,
23 created_at TIMESTAMP default CURRENT_TIMESTAMP not null
24 );
25 CREATE INDEX IF NOT EXISTS idx_filecodes_code_1c7ee7
26 on filecodes (code);
27 """
28 )
29
30
31async def create_key_value_table():

Callers 1

migrateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected