Skip to content

Commit 970fced

Browse files
committed
fix(api): correct syntax and constraints in headlines schema
The server was failing to start due to a syntax error (a missing comma) in the `CREATE TABLE` statement for the `headlines` table. Additionally, the schema incorrectly defined the `image_url`, `url`, and `published_at` columns as `NOT NULL`, which contradicted the nullable fields in the `Headline` data model. This change corrects the syntax error and removes the incorrect `NOT NULL` constraints, fully aligning the database schema with the model and resolving the startup failure.
1 parent 0a777a6 commit 970fced

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/src/services/database_seeding_service.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ class DatabaseSeedingService {
107107
title TEXT NOT NULL,
108108
source_id TEXT NOT NULL,
109109
category_id TEXT NOT NULL,
110-
image_url TEXT NOT NULL,
111-
url TEXT NOT NULL,
112-
published_at TIMESTAMPTZ NOT NULL,
110+
image_url TEXT,
111+
url TEXT,
112+
published_at TIMESTAMPTZ,
113113
description TEXT,
114114
content TEXT,
115115
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
116-
updated_at TIMESTAMPTZ
116+
updated_at TIMESTAMPTZ,
117117
status TEXT,
118118
type TEXT
119119
);

0 commit comments

Comments
 (0)