18 lines
751 B
SQL
18 lines
751 B
SQL
-- Task Manager Database Initialization
|
|
-- Creates the tasks table for the application
|
|
|
|
CREATE TABLE IF NOT EXISTS tasks (
|
|
id SERIAL PRIMARY KEY,
|
|
title VARCHAR(255) NOT NULL,
|
|
description TEXT DEFAULT '',
|
|
completed BOOLEAN DEFAULT FALSE,
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
-- Insert sample tasks so the app isn't empty on first load
|
|
INSERT INTO tasks (title, description, completed) VALUES
|
|
('Welcome to Task Manager', 'This is a sample task. You can edit or delete it.', FALSE),
|
|
('Try creating a new task', 'Click the "Add Task" button to create your own tasks.', FALSE),
|
|
('Mark tasks as complete', 'Click the checkbox to mark a task as done.', TRUE);
|