diff --git a/services/api/database/migrations/20240501000000_organization_quotas.js b/services/api/database/migrations/20240501000000_organization_quotas.js index 128cef9614..773fa91636 100644 --- a/services/api/database/migrations/20240501000000_organization_quotas.js +++ b/services/api/database/migrations/20240501000000_organization_quotas.js @@ -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()); + }) }; /** @@ -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'); + }) }; diff --git a/services/api/src/typeDefs.js b/services/api/src/typeDefs.js index 40f116ac0c..5f3a567c65 100644 --- a/services/api/src/typeDefs.js +++ b/services/api/src/typeDefs.js @@ -1109,6 +1109,7 @@ const typeDefs = gql` groups: [OrgGroupInterface] owners: [OrgUser] notifications(type: NotificationType): [Notification] + created: String } input AddOrganizationInput {