feat(v4.4.0): Tasks, Sub-items & Dependencies
- Add is_task flag on collections (toggle-task API) - New page_dependencies table with auto_shift config (blocks/blocked_by/related) - API: GET/POST/DELETE page dependencies - API: POST auto-shift dates based on blocking dependencies (skip_weekends option) - 5 new tests (171 total)
This commit is contained in:
@@ -515,6 +515,27 @@ def init_db():
|
||||
""")
|
||||
conn.commit()
|
||||
|
||||
# v4.4.0: Tasks & Dependencies
|
||||
# Add is_task flag to collections
|
||||
try:
|
||||
conn.execute("ALTER TABLE collections ADD COLUMN is_task BOOLEAN NOT NULL DEFAULT 0")
|
||||
except sqlite3.OperationalError:
|
||||
pass
|
||||
|
||||
# Dependencies table: bloque/bloqué par with auto-shift config
|
||||
conn.execute("""
|
||||
CREATE TABLE IF NOT EXISTS page_dependencies (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
page_id INTEGER NOT NULL REFERENCES collection_pages(id) ON DELETE CASCADE,
|
||||
dependency_id INTEGER NOT NULL REFERENCES collection_pages(id) ON DELETE CASCADE,
|
||||
dependency_type TEXT NOT NULL DEFAULT 'blocks',
|
||||
auto_shift TEXT DEFAULT 'overlap',
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
UNIQUE(page_id, dependency_id, dependency_type)
|
||||
)
|
||||
""")
|
||||
conn.commit()
|
||||
|
||||
|
||||
@contextmanager
|
||||
def get_conn():
|
||||
|
||||
Reference in New Issue
Block a user