Skip to content

Commit

Permalink
refactor: add created timestamp to organizations
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed May 13, 2024
1 parent afb1a58 commit 5b11bc8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ exports.up = function(knex) {
.raw(`ALTER TABLE organization ALTER quota_group SET DEFAULT -1;`)
.raw(`ALTER TABLE organization ALTER quota_notification SET DEFAULT -1;`)
.raw(`ALTER TABLE organization ALTER quota_environment SET DEFAULT -1;`)
.alterTable('organization', function (table) {
table.timestamp('created').defaultTo(knex.fn.now());
})
};

/**
Expand All @@ -22,4 +25,7 @@ exports.down = function(knex) {
.raw(`ALTER TABLE organization ALTER quota_group SET DEFAULT 10;`)
.raw(`ALTER TABLE organization ALTER quota_notification SET DEFAULT 10;`)
.raw(`ALTER TABLE organization ALTER quota_environment SET DEFAULT 5;`)
.alterTable('organization', (table) => {
table.dropColumn('created');
})
};
1 change: 1 addition & 0 deletions services/api/src/typeDefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,7 @@ const typeDefs = gql`
groups: [OrgGroupInterface]
owners: [OrgUser]
notifications(type: NotificationType): [Notification]
created: String
}
input AddOrganizationInput {
Expand Down

0 comments on commit 5b11bc8

Please sign in to comment.