Skip to content

Commit f2eb791

Browse files
committed
feat: ensure that the project_id field in projects can't be null
1 parent 307ac54 commit f2eb791

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/database/migrations/1733318617773_add_github_orgs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ exports.up = async (knex) => {
5555

5656
// Foreign key to 'projects' table
5757
table.integer('project_id')
58+
.notNullable()
5859
.unsigned()
5960
.references('id')
6061
.inTable('projects')

src/database/schema/schema.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ CREATE TABLE public.github_organizations (
9191
github_archived_at timestamp with time zone,
9292
created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
9393
updated_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
94-
project_id integer
94+
project_id integer NOT NULL
9595
);
9696

9797

0 commit comments

Comments
 (0)