document_a
This commit is contained in:
63
database.js
63
database.js
@@ -260,31 +260,34 @@ function createSQLiteTables() {
|
||||
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
)`);
|
||||
|
||||
db.run(`CREATE TABLE IF NOT EXISTS tasks (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
title TEXT NOT NULL,
|
||||
description TEXT,
|
||||
status TEXT DEFAULT 'active',
|
||||
created_by INTEGER NOT NULL,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
deleted_at DATETIME,
|
||||
deleted_by INTEGER,
|
||||
original_task_id INTEGER,
|
||||
start_date DATETIME,
|
||||
due_date DATETIME,
|
||||
rework_comment TEXT,
|
||||
closed_at DATETIME,
|
||||
closed_by INTEGER,
|
||||
task_type TEXT DEFAULT "regular",
|
||||
type TEXT,
|
||||
approver_group_id INTEGER,
|
||||
document_id INTEGER,
|
||||
FOREIGN KEY (created_by) REFERENCES users (id),
|
||||
FOREIGN KEY (deleted_by) REFERENCES users (id),
|
||||
FOREIGN KEY (original_task_id) REFERENCES tasks (id),
|
||||
FOREIGN KEY (closed_by) REFERENCES users (id)
|
||||
)`);
|
||||
db.run(`CREATE TABLE IF NOT EXISTS tasks (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
title TEXT NOT NULL,
|
||||
description TEXT,
|
||||
status TEXT DEFAULT 'active',
|
||||
created_by INTEGER NOT NULL,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
deleted_at DATETIME,
|
||||
deleted_by INTEGER,
|
||||
original_task_id INTEGER,
|
||||
start_date DATETIME,
|
||||
due_date DATETIME,
|
||||
rework_comment TEXT,
|
||||
closed_at DATETIME,
|
||||
closed_by INTEGER,
|
||||
task_type TEXT DEFAULT "regular",
|
||||
type TEXT,
|
||||
approver_group_id INTEGER,
|
||||
document_id INTEGER,
|
||||
document_n TEXT,
|
||||
document_d TEXT,
|
||||
document_a TEXT,
|
||||
FOREIGN KEY (created_by) REFERENCES users (id),
|
||||
FOREIGN KEY (deleted_by) REFERENCES users (id),
|
||||
FOREIGN KEY (original_task_id) REFERENCES tasks (id),
|
||||
FOREIGN KEY (closed_by) REFERENCES users (id)
|
||||
)`);
|
||||
|
||||
db.run(`CREATE TABLE IF NOT EXISTS task_assignments (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
@@ -720,7 +723,10 @@ function checkAndUpdateTableStructure() {
|
||||
{ name: 'task_type', type: 'TEXT DEFAULT "regular"' },
|
||||
{ name: 'type', type: 'TEXT' },
|
||||
{ name: 'approver_group_id', type: 'INTEGER' },
|
||||
{ name: 'document_id', type: 'INTEGER' }
|
||||
{ name: 'document_id', type: 'INTEGER' },
|
||||
{ name: 'document_n', type: 'TEXT' },
|
||||
{ name: 'document_d', type: 'TEXT' },
|
||||
{ name: 'document_a', type: 'TEXT' }
|
||||
],
|
||||
task_assignments: [
|
||||
{ name: 'id', type: 'INTEGER PRIMARY KEY AUTOINCREMENT' },
|
||||
@@ -1106,7 +1112,10 @@ async function createPostgresTables() {
|
||||
task_type VARCHAR(50) DEFAULT 'regular',
|
||||
type VARCHAR(100),
|
||||
approver_group_id INTEGER,
|
||||
document_id INTEGER
|
||||
document_id INTEGER,
|
||||
document_n TEXT,
|
||||
document_d TEXT,
|
||||
document_a TEXT
|
||||
)
|
||||
`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user