Skip to content

Commit

Permalink
Changed the timestamp fields to support default current timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
akanksh5 committed Mar 1, 2024
1 parent 88863e3 commit a1e4b3b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/db/sqlite/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
CREATE TABLE IF NOT EXISTS resource_group_mapping (
resource_uuid TEXT REFERENCES resources(uuid),
group_uuid TEXT NOT NULL REFERENCES group_resource_list_mapping(uuid),
created_at INTEGER NOT NULL,
updated_at INTEGER NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
);

CREATE TABLE IF NOT EXISTS group_resource_list_mapping (
group_uuid TEXT,
resource_uuid TEXT NOT NULL REFERENCES resources(uuid),
index_in_list INTEGER NOT NULL,
created_at INTEGER NOT NULL,
updated_at INTEGER NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
);


Expand All @@ -24,8 +24,8 @@ CREATE TABLE IF NOT EXISTS resources (
content_md TEXT NOT NULL,
image_url TEXT,
resource_type TEXT NOT NULL,
created_at INTEGER NOT NULL,
updated_at INTEGER NOT NULL
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
);

-- Create the 'events' table which is a table of event resources.
Expand Down

0 comments on commit a1e4b3b

Please sign in to comment.