Skip to content

Commit

Permalink
fix: add nullable constraint for FK repos -> organization (#160)
Browse files Browse the repository at this point in the history
Co-authored-by: Guillermo C. Martínez <telekosmos@mymail.com>
  • Loading branch information
telekosmos and Guillermo C. Martínez authored Dec 23, 2024
1 parent 6cb3559 commit d12e5a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/database/migrations/1733435340266_add_github_repos.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ exports.up = async (knex) => {
table.enu('secret_scanning_validity_checks_status', ['enabled', 'disabled']).defaultTo('disabled')

// Foreign key to 'github_organizations' table
table
.integer('github_organization_id')
table.integer('github_organization_id')
.notNullable()
.unsigned()
.references('id')
.inTable('github_organizations')
Expand Down
2 changes: 1 addition & 1 deletion src/database/schema/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ CREATE TABLE public.github_repositories (
dependabot_security_updates_status text DEFAULT 'disabled'::text,
secret_scanning_non_provider_patterns_status text DEFAULT 'disabled'::text,
secret_scanning_validity_checks_status text DEFAULT 'disabled'::text,
github_organization_id integer,
github_organization_id integer NOT NULL,
created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
CONSTRAINT github_repositories_dependabot_security_updates_status_check CHECK ((dependabot_security_updates_status = ANY (ARRAY['enabled'::text, 'disabled'::text]))),
Expand Down

0 comments on commit d12e5a6

Please sign in to comment.