1 Commits

Author SHA1 Message Date
db-agent bb722db96e feat: init db module with schema, seed and migration 2026-08-15 15:15:04 +00:00
6 changed files with 37 additions and 22 deletions
-8
View File
@@ -1,8 +0,0 @@
<!DOCTYPE html>
<html>
<head><title>UI Module</title></head>
<body>
<div id="app">Loading...</div>
<script src="src/app.js"></script>
</body>
</html>
+21
View File
@@ -0,0 +1,21 @@
import sqlite3
import os
DB_PATH = 'app.db'
def migrate():
conn = sqlite3.connect(DB_PATH)
cursor = conn.cursor()
with open('schema.sql', 'r') as f:
cursor.executescript(f.read())
with open('seed.sql', 'r') as f:
cursor.executescript(f.read())
conn.commit()
conn.close()
print(f"Database migrated: {DB_PATH}")
if __name__ == '__main__':
migrate()
+13
View File
@@ -0,0 +1,13 @@
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
email TEXT UNIQUE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS sessions (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER REFERENCES users(id),
token TEXT NOT NULL,
expires_at TIMESTAMP NOT NULL
);
+3
View File
@@ -0,0 +1,3 @@
INSERT INTO users (name, email) VALUES ('Alice', 'alice@example.com');
INSERT INTO users (name, email) VALUES ('Bob', 'bob@example.com');
INSERT INTO users (name, email) VALUES ('Charlie', 'charlie@example.com');
-10
View File
@@ -1,10 +0,0 @@
console.log('UI App initialized');
console.log('UI Module v1.0.0-rc1 - incrementally synced');
export function render() {
document.getElementById('app').innerHTML = 'Hello from UI Module v1.0.0-rc1';
}
export function getVersion() {
return '1.0.0-rc1';
}
-4
View File
@@ -1,4 +0,0 @@
/* UI Module Styles v1.0.0-rc1 */
body { font-family: sans-serif; margin: 0; padding: 20px; background: #f9f9f9; }
#app { color: #333; }
.header { border-bottom: 2px solid #007bff; padding-bottom: 10px; margin-bottom: 20px; }