feat: add default value capability (#2544)
* feat: add default value capability * feat: update seeds with default value
This commit is contained in:
@ -40,6 +40,7 @@ export const seedActivityTargetFieldMetadata = async (
|
||||
'icon',
|
||||
'isNullable',
|
||||
'isSystem',
|
||||
'defaultValue',
|
||||
])
|
||||
.orIgnore()
|
||||
.values([
|
||||
@ -58,8 +59,9 @@ export const seedActivityTargetFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'uuid' },
|
||||
},
|
||||
{
|
||||
id: SeedActivityTargetFieldMetadataIds.CreatedAt,
|
||||
@ -75,8 +77,9 @@ export const seedActivityTargetFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
{
|
||||
id: SeedActivityTargetFieldMetadataIds.UpdatedAt,
|
||||
@ -92,8 +95,9 @@ export const seedActivityTargetFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
// Relationships
|
||||
{
|
||||
@ -110,6 +114,7 @@ export const seedActivityTargetFieldMetadata = async (
|
||||
icon: 'IconNotes',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedActivityTargetFieldMetadataIds.ActivityForeignKey,
|
||||
@ -125,6 +130,7 @@ export const seedActivityTargetFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedActivityTargetFieldMetadataIds.Person,
|
||||
@ -140,6 +146,7 @@ export const seedActivityTargetFieldMetadata = async (
|
||||
icon: 'IconUser',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedActivityTargetFieldMetadataIds.PersonForeignKey,
|
||||
@ -155,6 +162,7 @@ export const seedActivityTargetFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedActivityTargetFieldMetadataIds.Company,
|
||||
@ -170,6 +178,7 @@ export const seedActivityTargetFieldMetadata = async (
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedActivityTargetFieldMetadataIds.CompanyForeignKey,
|
||||
@ -185,6 +194,7 @@ export const seedActivityTargetFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
])
|
||||
.execute();
|
||||
|
||||
@ -48,6 +48,7 @@ export const seedActivityFieldMetadata = async (
|
||||
'icon',
|
||||
'isNullable',
|
||||
'isSystem',
|
||||
'defaultValue',
|
||||
])
|
||||
.orIgnore()
|
||||
.values([
|
||||
@ -66,8 +67,9 @@ export const seedActivityFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'uuid' },
|
||||
},
|
||||
{
|
||||
id: SeedActivityFieldMetadataIds.CreatedAt,
|
||||
@ -83,8 +85,9 @@ export const seedActivityFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
{
|
||||
id: SeedActivityFieldMetadataIds.UpdatedAt,
|
||||
@ -100,8 +103,9 @@ export const seedActivityFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
// Primary identifier
|
||||
{
|
||||
@ -120,6 +124,7 @@ export const seedActivityFieldMetadata = async (
|
||||
icon: 'IconNotes',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
|
||||
// Scalar fields
|
||||
@ -139,6 +144,7 @@ export const seedActivityFieldMetadata = async (
|
||||
icon: 'IconList',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedActivityFieldMetadataIds.Type,
|
||||
@ -156,6 +162,7 @@ export const seedActivityFieldMetadata = async (
|
||||
icon: 'IconCheckbox',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedActivityFieldMetadataIds.ReminderAt,
|
||||
@ -173,6 +180,7 @@ export const seedActivityFieldMetadata = async (
|
||||
icon: 'IconCalendarEvent',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedActivityFieldMetadataIds.DueAt,
|
||||
@ -190,6 +198,7 @@ export const seedActivityFieldMetadata = async (
|
||||
icon: 'IconCalendarEvent',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedActivityFieldMetadataIds.CompletedAt,
|
||||
@ -207,6 +216,7 @@ export const seedActivityFieldMetadata = async (
|
||||
icon: 'IconCheck',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
|
||||
// Relationships
|
||||
@ -224,6 +234,7 @@ export const seedActivityFieldMetadata = async (
|
||||
icon: 'IconCheckbox',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedActivityFieldMetadataIds.Attachments,
|
||||
@ -239,6 +250,7 @@ export const seedActivityFieldMetadata = async (
|
||||
icon: 'IconFileImport',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedActivityFieldMetadataIds.Comments,
|
||||
@ -254,6 +266,7 @@ export const seedActivityFieldMetadata = async (
|
||||
icon: 'IconComment',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedActivityFieldMetadataIds.Author,
|
||||
@ -272,6 +285,7 @@ export const seedActivityFieldMetadata = async (
|
||||
icon: 'IconUserCircle',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedActivityFieldMetadataIds.AuthorForeignKey,
|
||||
@ -287,6 +301,7 @@ export const seedActivityFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedActivityFieldMetadataIds.Assignee,
|
||||
@ -303,6 +318,7 @@ export const seedActivityFieldMetadata = async (
|
||||
icon: 'IconUserCircle',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedActivityFieldMetadataIds.AssigneeForeignKey,
|
||||
@ -318,6 +334,7 @@ export const seedActivityFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
])
|
||||
.execute();
|
||||
|
||||
@ -37,6 +37,7 @@ export const seedApiKeyFieldMetadata = async (
|
||||
'icon',
|
||||
'isNullable',
|
||||
'isSystem',
|
||||
'defaultValue',
|
||||
])
|
||||
.orIgnore()
|
||||
.values([
|
||||
@ -57,6 +58,7 @@ export const seedApiKeyFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'uuid' },
|
||||
},
|
||||
{
|
||||
id: SeedApiKeyFieldMetadataIds.CreatedAt,
|
||||
@ -72,8 +74,9 @@ export const seedApiKeyFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
{
|
||||
id: SeedApiKeyFieldMetadataIds.UpdatedAt,
|
||||
@ -89,8 +92,9 @@ export const seedApiKeyFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
// Scalar fields
|
||||
{
|
||||
@ -109,6 +113,7 @@ export const seedApiKeyFieldMetadata = async (
|
||||
icon: 'IconLink',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedApiKeyFieldMetadataIds.ExpiresAt,
|
||||
@ -126,6 +131,7 @@ export const seedApiKeyFieldMetadata = async (
|
||||
icon: 'IconCalendar',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedApiKeyFieldMetadataIds.RevokedAt,
|
||||
@ -143,6 +149,7 @@ export const seedApiKeyFieldMetadata = async (
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
])
|
||||
.execute();
|
||||
|
||||
@ -46,6 +46,7 @@ export const seedAttachmentFieldMetadata = async (
|
||||
'icon',
|
||||
'isNullable',
|
||||
'isSystem',
|
||||
'defaultValue',
|
||||
])
|
||||
.orIgnore()
|
||||
.values([
|
||||
@ -64,8 +65,9 @@ export const seedAttachmentFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'uuid' },
|
||||
},
|
||||
{
|
||||
id: SeedAttachmentFieldMetadataIds.CreatedAt,
|
||||
@ -81,8 +83,9 @@ export const seedAttachmentFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
{
|
||||
id: SeedAttachmentFieldMetadataIds.UpdatedAt,
|
||||
@ -98,8 +101,9 @@ export const seedAttachmentFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
// Primary Identifier
|
||||
{
|
||||
@ -118,6 +122,7 @@ export const seedAttachmentFieldMetadata = async (
|
||||
icon: 'IconFileUpload',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
// Scalar fields
|
||||
{
|
||||
@ -136,6 +141,7 @@ export const seedAttachmentFieldMetadata = async (
|
||||
icon: 'IconLink',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
id: SeedAttachmentFieldMetadataIds.Type,
|
||||
@ -153,6 +159,7 @@ export const seedAttachmentFieldMetadata = async (
|
||||
icon: 'IconList',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
|
||||
// Relationships
|
||||
@ -170,6 +177,7 @@ export const seedAttachmentFieldMetadata = async (
|
||||
icon: 'IconCircleUser',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedAttachmentFieldMetadataIds.AuthorForeignKey,
|
||||
@ -185,6 +193,7 @@ export const seedAttachmentFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedAttachmentFieldMetadataIds.Activity,
|
||||
@ -200,6 +209,7 @@ export const seedAttachmentFieldMetadata = async (
|
||||
icon: 'IconNotes',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedAttachmentFieldMetadataIds.ActivityForeignKey,
|
||||
@ -215,6 +225,7 @@ export const seedAttachmentFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedAttachmentFieldMetadataIds.Person,
|
||||
@ -230,6 +241,7 @@ export const seedAttachmentFieldMetadata = async (
|
||||
icon: 'IconUser',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedAttachmentFieldMetadataIds.PersonForeignKey,
|
||||
@ -245,6 +257,7 @@ export const seedAttachmentFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedAttachmentFieldMetadataIds.Company,
|
||||
@ -260,6 +273,7 @@ export const seedAttachmentFieldMetadata = async (
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedAttachmentFieldMetadataIds.CompanyForeignKey,
|
||||
@ -275,6 +289,7 @@ export const seedAttachmentFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
])
|
||||
.execute();
|
||||
|
||||
@ -39,6 +39,7 @@ export const seedCommentFieldMetadata = async (
|
||||
'icon',
|
||||
'isNullable',
|
||||
'isSystem',
|
||||
'defaultValue',
|
||||
])
|
||||
.orIgnore()
|
||||
.values([
|
||||
@ -57,8 +58,9 @@ export const seedCommentFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'uuid' },
|
||||
},
|
||||
{
|
||||
id: SeedCommentFieldMetadataIds.CreatedAt,
|
||||
@ -74,8 +76,9 @@ export const seedCommentFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
{
|
||||
id: SeedCommentFieldMetadataIds.UpdatedAt,
|
||||
@ -91,8 +94,9 @@ export const seedCommentFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
// Scalar fields
|
||||
{
|
||||
@ -111,6 +115,7 @@ export const seedCommentFieldMetadata = async (
|
||||
icon: 'IconLink',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
// Relationships
|
||||
{
|
||||
@ -127,6 +132,7 @@ export const seedCommentFieldMetadata = async (
|
||||
icon: 'IconCircleUser',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedCommentFieldMetadataIds.AuthorForeignKey,
|
||||
@ -142,6 +148,7 @@ export const seedCommentFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedCommentFieldMetadataIds.Activity,
|
||||
@ -157,6 +164,7 @@ export const seedCommentFieldMetadata = async (
|
||||
icon: 'IconNotes',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedCommentFieldMetadataIds.ActivityForeignKey,
|
||||
@ -172,6 +180,7 @@ export const seedCommentFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
])
|
||||
.execute();
|
||||
|
||||
@ -51,6 +51,7 @@ export const seedCompanyFieldMetadata = async (
|
||||
'icon',
|
||||
'isNullable',
|
||||
'isSystem',
|
||||
'defaultValue',
|
||||
])
|
||||
.orIgnore()
|
||||
.values([
|
||||
@ -69,8 +70,9 @@ export const seedCompanyFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'uuid' },
|
||||
},
|
||||
{
|
||||
id: SeedCompanyFieldMetadataIds.CreatedAt,
|
||||
@ -86,8 +88,9 @@ export const seedCompanyFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
{
|
||||
id: SeedCompanyFieldMetadataIds.UpdatedAt,
|
||||
@ -103,8 +106,9 @@ export const seedCompanyFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
// Main Identifier
|
||||
{
|
||||
@ -123,6 +127,7 @@ export const seedCompanyFieldMetadata = async (
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
|
||||
// Scalar Fields
|
||||
@ -143,6 +148,7 @@ export const seedCompanyFieldMetadata = async (
|
||||
icon: 'IconLink',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedCompanyFieldMetadataIds.Address,
|
||||
@ -160,6 +166,7 @@ export const seedCompanyFieldMetadata = async (
|
||||
icon: 'IconMap',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedCompanyFieldMetadataIds.Employees,
|
||||
@ -177,6 +184,7 @@ export const seedCompanyFieldMetadata = async (
|
||||
icon: 'IconUsers',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedCompanyFieldMetadataIds.LinkedinUrl,
|
||||
@ -194,6 +202,7 @@ export const seedCompanyFieldMetadata = async (
|
||||
icon: 'IconBrandLinkedin',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedCompanyFieldMetadataIds.XUrl,
|
||||
@ -211,6 +220,7 @@ export const seedCompanyFieldMetadata = async (
|
||||
icon: 'IconBrandX',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedCompanyFieldMetadataIds.AnnualRecurringRevenue,
|
||||
@ -229,6 +239,7 @@ export const seedCompanyFieldMetadata = async (
|
||||
icon: 'IconMoneybag',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedCompanyFieldMetadataIds.IdealCustomerProfile,
|
||||
@ -247,6 +258,7 @@ export const seedCompanyFieldMetadata = async (
|
||||
icon: 'IconTarget',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
|
||||
// Relationships
|
||||
@ -264,6 +276,7 @@ export const seedCompanyFieldMetadata = async (
|
||||
icon: 'IconUsers',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedCompanyFieldMetadataIds.AccountOwner,
|
||||
@ -280,6 +293,7 @@ export const seedCompanyFieldMetadata = async (
|
||||
icon: 'IconUserCircle',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedCompanyFieldMetadataIds.AccountOwnerForeignKey,
|
||||
@ -295,6 +309,7 @@ export const seedCompanyFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedCompanyFieldMetadataIds.ActivityTargets,
|
||||
@ -310,6 +325,7 @@ export const seedCompanyFieldMetadata = async (
|
||||
icon: 'IconCheckbox',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedCompanyFieldMetadataIds.Opportunities,
|
||||
@ -325,6 +341,7 @@ export const seedCompanyFieldMetadata = async (
|
||||
icon: 'IconTargetArrow',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedCompanyFieldMetadataIds.Favorites,
|
||||
@ -340,6 +357,7 @@ export const seedCompanyFieldMetadata = async (
|
||||
icon: 'IconHeart',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedCompanyFieldMetadataIds.Attachments,
|
||||
@ -355,6 +373,7 @@ export const seedCompanyFieldMetadata = async (
|
||||
icon: 'IconFileImport',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
])
|
||||
.execute();
|
||||
|
||||
@ -43,6 +43,7 @@ export const seedFavoriteFieldMetadata = async (
|
||||
'icon',
|
||||
'isNullable',
|
||||
'isSystem',
|
||||
'defaultValue',
|
||||
])
|
||||
.orIgnore()
|
||||
.values([
|
||||
@ -61,8 +62,9 @@ export const seedFavoriteFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'uuid' },
|
||||
},
|
||||
{
|
||||
id: SeedFavoriteFieldMetadataIds.CreatedAt,
|
||||
@ -78,8 +80,9 @@ export const seedFavoriteFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
{
|
||||
id: SeedFavoriteFieldMetadataIds.UpdatedAt,
|
||||
@ -95,8 +98,9 @@ export const seedFavoriteFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
// Scalar fields
|
||||
{
|
||||
@ -115,6 +119,7 @@ export const seedFavoriteFieldMetadata = async (
|
||||
icon: 'IconList',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: 0 },
|
||||
},
|
||||
|
||||
// Relationships
|
||||
@ -132,6 +137,7 @@ export const seedFavoriteFieldMetadata = async (
|
||||
icon: 'IconCircleUser',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedFavoriteFieldMetadataIds.WorkspaceMemberForeignKey,
|
||||
@ -147,6 +153,7 @@ export const seedFavoriteFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedFavoriteFieldMetadataIds.Person,
|
||||
@ -164,6 +171,7 @@ export const seedFavoriteFieldMetadata = async (
|
||||
icon: 'IconUser',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedFavoriteFieldMetadataIds.PersonForeignKey,
|
||||
@ -179,6 +187,7 @@ export const seedFavoriteFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedFavoriteFieldMetadataIds.Company,
|
||||
@ -194,6 +203,7 @@ export const seedFavoriteFieldMetadata = async (
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedFavoriteFieldMetadataIds.CompanyForeignKey,
|
||||
@ -209,6 +219,7 @@ export const seedFavoriteFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
])
|
||||
.execute();
|
||||
|
||||
@ -46,6 +46,7 @@ export const seedOpportunityFieldMetadata = async (
|
||||
'icon',
|
||||
'isNullable',
|
||||
'isSystem',
|
||||
'defaultValue',
|
||||
])
|
||||
.orIgnore()
|
||||
.values([
|
||||
@ -64,8 +65,9 @@ export const seedOpportunityFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'uuid' },
|
||||
},
|
||||
{
|
||||
id: SeedOpportunityFieldMetadataIds.CreatedAt,
|
||||
@ -81,8 +83,9 @@ export const seedOpportunityFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
{
|
||||
id: SeedOpportunityFieldMetadataIds.UpdatedAt,
|
||||
@ -98,8 +101,9 @@ export const seedOpportunityFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
// Scalar fields
|
||||
{
|
||||
@ -118,6 +122,7 @@ export const seedOpportunityFieldMetadata = async (
|
||||
icon: 'IconCurrencyDollar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedOpportunityFieldMetadataIds.CloseDate,
|
||||
@ -135,6 +140,7 @@ export const seedOpportunityFieldMetadata = async (
|
||||
icon: 'IconCalendarEvent',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedOpportunityFieldMetadataIds.Probability,
|
||||
@ -152,6 +158,7 @@ export const seedOpportunityFieldMetadata = async (
|
||||
icon: 'IconProgressCheck',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
// Relationships
|
||||
{
|
||||
@ -168,6 +175,7 @@ export const seedOpportunityFieldMetadata = async (
|
||||
icon: 'IconKanban',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedOpportunityFieldMetadataIds.PipelineStepForeignKey,
|
||||
@ -183,6 +191,7 @@ export const seedOpportunityFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedOpportunityFieldMetadataIds.PointOfContact,
|
||||
@ -198,6 +207,7 @@ export const seedOpportunityFieldMetadata = async (
|
||||
icon: 'IconUser',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedOpportunityFieldMetadataIds.PointOfContactForeignKey,
|
||||
@ -213,6 +223,7 @@ export const seedOpportunityFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedOpportunityFieldMetadataIds.Person,
|
||||
@ -228,6 +239,7 @@ export const seedOpportunityFieldMetadata = async (
|
||||
icon: 'IconUser',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedOpportunityFieldMetadataIds.PersonForeignKey,
|
||||
@ -243,6 +255,7 @@ export const seedOpportunityFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedOpportunityFieldMetadataIds.Company,
|
||||
@ -258,6 +271,7 @@ export const seedOpportunityFieldMetadata = async (
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedOpportunityFieldMetadataIds.CompanyForeignKey,
|
||||
@ -273,6 +287,7 @@ export const seedOpportunityFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
])
|
||||
.execute();
|
||||
|
||||
@ -52,6 +52,7 @@ export const seedPersonFieldMetadata = async (
|
||||
'icon',
|
||||
'isNullable',
|
||||
'isSystem',
|
||||
'defaultValue',
|
||||
])
|
||||
.orIgnore()
|
||||
.values([
|
||||
@ -70,8 +71,9 @@ export const seedPersonFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'uuid' },
|
||||
},
|
||||
{
|
||||
id: SeedPersonFieldMetadataIds.CreatedAt,
|
||||
@ -87,8 +89,9 @@ export const seedPersonFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
{
|
||||
id: SeedPersonFieldMetadataIds.UpdatedAt,
|
||||
@ -104,8 +107,9 @@ export const seedPersonFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
// Main Identifier
|
||||
{
|
||||
@ -124,6 +128,7 @@ export const seedPersonFieldMetadata = async (
|
||||
icon: 'IconUser',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
id: SeedPersonFieldMetadataIds.LastName,
|
||||
@ -141,6 +146,7 @@ export const seedPersonFieldMetadata = async (
|
||||
icon: 'IconUser',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
|
||||
// Scalar Fields
|
||||
@ -160,6 +166,7 @@ export const seedPersonFieldMetadata = async (
|
||||
icon: 'IconMail',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedPersonFieldMetadataIds.LinkedinUrl,
|
||||
@ -177,6 +184,7 @@ export const seedPersonFieldMetadata = async (
|
||||
icon: 'IconBrandLinkedin',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedPersonFieldMetadataIds.XUrl,
|
||||
@ -194,6 +202,7 @@ export const seedPersonFieldMetadata = async (
|
||||
icon: 'IconUser',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedPersonFieldMetadataIds.JobTitle,
|
||||
@ -211,6 +220,7 @@ export const seedPersonFieldMetadata = async (
|
||||
icon: 'IconBriefcase',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedPersonFieldMetadataIds.Phone,
|
||||
@ -228,6 +238,7 @@ export const seedPersonFieldMetadata = async (
|
||||
icon: 'IconPhone',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedPersonFieldMetadataIds.City,
|
||||
@ -245,6 +256,7 @@ export const seedPersonFieldMetadata = async (
|
||||
icon: 'IconMap',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedPersonFieldMetadataIds.AvatarUrl,
|
||||
@ -262,6 +274,7 @@ export const seedPersonFieldMetadata = async (
|
||||
icon: 'IconFileUpload',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
|
||||
// Relationships
|
||||
@ -279,6 +292,7 @@ export const seedPersonFieldMetadata = async (
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedPersonFieldMetadataIds.CompanyForeignKey,
|
||||
@ -294,6 +308,7 @@ export const seedPersonFieldMetadata = async (
|
||||
icon: undefined,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedPersonFieldMetadataIds.ContactForOpportunities,
|
||||
@ -309,6 +324,7 @@ export const seedPersonFieldMetadata = async (
|
||||
icon: 'IconArrowTarget',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedPersonFieldMetadataIds.ActivityTargets,
|
||||
@ -324,6 +340,7 @@ export const seedPersonFieldMetadata = async (
|
||||
icon: 'IconCheckbox',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedPersonFieldMetadataIds.Opportunities,
|
||||
@ -339,6 +356,7 @@ export const seedPersonFieldMetadata = async (
|
||||
icon: 'IconTargetArrow',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedPersonFieldMetadataIds.Favorites,
|
||||
@ -354,6 +372,7 @@ export const seedPersonFieldMetadata = async (
|
||||
icon: 'IconHeart',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedPersonFieldMetadataIds.Attachments,
|
||||
@ -369,6 +388,7 @@ export const seedPersonFieldMetadata = async (
|
||||
icon: 'IconFileImport',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
])
|
||||
.execute();
|
||||
|
||||
@ -38,6 +38,7 @@ export const seedPipelineStepFieldMetadata = async (
|
||||
'icon',
|
||||
'isNullable',
|
||||
'isSystem',
|
||||
'defaultValue',
|
||||
])
|
||||
.orIgnore()
|
||||
.values([
|
||||
@ -56,8 +57,9 @@ export const seedPipelineStepFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'uuid' },
|
||||
},
|
||||
{
|
||||
id: SeedPipelineStepFieldMetadataIds.CreatedAt,
|
||||
@ -73,8 +75,9 @@ export const seedPipelineStepFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
{
|
||||
id: SeedPipelineStepFieldMetadataIds.UpdatedAt,
|
||||
@ -90,8 +93,9 @@ export const seedPipelineStepFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
// Main Identifier
|
||||
{
|
||||
@ -110,6 +114,7 @@ export const seedPipelineStepFieldMetadata = async (
|
||||
icon: 'IconCurrencyDollar',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
|
||||
// Scalar Fields
|
||||
@ -129,6 +134,7 @@ export const seedPipelineStepFieldMetadata = async (
|
||||
icon: 'IconColorSwatch',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
id: SeedPipelineStepFieldMetadataIds.Position,
|
||||
@ -146,6 +152,7 @@ export const seedPipelineStepFieldMetadata = async (
|
||||
icon: 'IconHierarchy2',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: 0 },
|
||||
},
|
||||
|
||||
// Relationships
|
||||
@ -163,6 +170,7 @@ export const seedPipelineStepFieldMetadata = async (
|
||||
icon: 'IconTargetArrow',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
])
|
||||
.execute();
|
||||
|
||||
@ -39,6 +39,7 @@ export const seedViewFieldFieldMetadata = async (
|
||||
'icon',
|
||||
'isNullable',
|
||||
'isSystem',
|
||||
'defaultValue',
|
||||
])
|
||||
.orIgnore()
|
||||
.values([
|
||||
@ -57,8 +58,9 @@ export const seedViewFieldFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'uuid' },
|
||||
},
|
||||
{
|
||||
id: SeedViewFieldFieldMetadataIds.CreatedAt,
|
||||
@ -74,8 +76,9 @@ export const seedViewFieldFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
{
|
||||
id: SeedViewFieldFieldMetadataIds.UpdatedAt,
|
||||
@ -91,8 +94,9 @@ export const seedViewFieldFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
// Fields
|
||||
{
|
||||
@ -111,6 +115,7 @@ export const seedViewFieldFieldMetadata = async (
|
||||
icon: 'IconTag',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
id: SeedViewFieldFieldMetadataIds.View,
|
||||
@ -126,6 +131,7 @@ export const seedViewFieldFieldMetadata = async (
|
||||
icon: 'IconLayoutCollage',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedViewFieldFieldMetadataIds.IsVisible,
|
||||
@ -143,6 +149,7 @@ export const seedViewFieldFieldMetadata = async (
|
||||
icon: 'IconEye',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: true },
|
||||
},
|
||||
{
|
||||
id: SeedViewFieldFieldMetadataIds.Size,
|
||||
@ -160,6 +167,7 @@ export const seedViewFieldFieldMetadata = async (
|
||||
icon: 'IconEye',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: 0 },
|
||||
},
|
||||
{
|
||||
id: SeedViewFieldFieldMetadataIds.Position,
|
||||
@ -177,6 +185,7 @@ export const seedViewFieldFieldMetadata = async (
|
||||
icon: 'IconList',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: 0 },
|
||||
},
|
||||
])
|
||||
.execute();
|
||||
|
||||
@ -39,6 +39,7 @@ export const seedViewFilterFieldMetadata = async (
|
||||
'icon',
|
||||
'isNullable',
|
||||
'isSystem',
|
||||
'defaultValue',
|
||||
])
|
||||
.orIgnore()
|
||||
.values([
|
||||
@ -57,8 +58,9 @@ export const seedViewFilterFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'uuid' },
|
||||
},
|
||||
{
|
||||
id: SeedViewFilterFieldMetadataIds.CreatedAt,
|
||||
@ -74,8 +76,9 @@ export const seedViewFilterFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
{
|
||||
id: SeedViewFilterFieldMetadataIds.UpdatedAt,
|
||||
@ -91,8 +94,9 @@ export const seedViewFilterFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
// Fields
|
||||
{
|
||||
@ -111,6 +115,7 @@ export const seedViewFilterFieldMetadata = async (
|
||||
icon: null,
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedViewFilterFieldMetadataIds.View,
|
||||
@ -128,6 +133,7 @@ export const seedViewFilterFieldMetadata = async (
|
||||
icon: 'IconLayoutCollage',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedViewFilterFieldMetadataIds.Operand,
|
||||
@ -145,6 +151,7 @@ export const seedViewFilterFieldMetadata = async (
|
||||
icon: null,
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
id: SeedViewFilterFieldMetadataIds.Value,
|
||||
@ -162,6 +169,7 @@ export const seedViewFilterFieldMetadata = async (
|
||||
icon: null,
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
id: SeedViewFilterFieldMetadataIds.DisplayValue,
|
||||
@ -179,6 +187,7 @@ export const seedViewFilterFieldMetadata = async (
|
||||
icon: null,
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
])
|
||||
.execute();
|
||||
|
||||
@ -37,6 +37,7 @@ export const seedViewSortFieldMetadata = async (
|
||||
'icon',
|
||||
'isNullable',
|
||||
'isSystem',
|
||||
'defaultValue',
|
||||
])
|
||||
.orIgnore()
|
||||
.values([
|
||||
@ -55,8 +56,9 @@ export const seedViewSortFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'uuid' },
|
||||
},
|
||||
{
|
||||
id: SeedViewSortFieldMetadataIds.CreatedAt,
|
||||
@ -72,8 +74,9 @@ export const seedViewSortFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
{
|
||||
id: SeedViewSortFieldMetadataIds.UpdatedAt,
|
||||
@ -89,8 +92,9 @@ export const seedViewSortFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
// Fields
|
||||
{
|
||||
@ -109,6 +113,7 @@ export const seedViewSortFieldMetadata = async (
|
||||
icon: null,
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedViewSortFieldMetadataIds.View,
|
||||
@ -126,6 +131,7 @@ export const seedViewSortFieldMetadata = async (
|
||||
icon: 'IconLayoutCollage',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedViewSortFieldMetadataIds.Direction,
|
||||
@ -143,6 +149,7 @@ export const seedViewSortFieldMetadata = async (
|
||||
icon: null,
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
])
|
||||
.execute();
|
||||
|
||||
@ -40,6 +40,7 @@ export const seedViewFieldMetadata = async (
|
||||
'icon',
|
||||
'isNullable',
|
||||
'isSystem',
|
||||
'defaultValue',
|
||||
])
|
||||
.orIgnore()
|
||||
.values([
|
||||
@ -58,8 +59,9 @@ export const seedViewFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'uuid' },
|
||||
},
|
||||
{
|
||||
id: SeedViewFieldMetadataIds.CreatedAt,
|
||||
@ -75,8 +77,9 @@ export const seedViewFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
{
|
||||
id: SeedViewFieldMetadataIds.UpdatedAt,
|
||||
@ -92,8 +95,9 @@ export const seedViewFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
// Fields
|
||||
{
|
||||
@ -112,6 +116,7 @@ export const seedViewFieldMetadata = async (
|
||||
icon: null,
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
id: SeedViewFieldMetadataIds.ObjectMetadataId,
|
||||
@ -129,6 +134,7 @@ export const seedViewFieldMetadata = async (
|
||||
icon: null,
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedViewFieldMetadataIds.Type,
|
||||
@ -146,6 +152,7 @@ export const seedViewFieldMetadata = async (
|
||||
icon: null,
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
id: SeedViewFieldMetadataIds.ViewFields,
|
||||
@ -161,6 +168,7 @@ export const seedViewFieldMetadata = async (
|
||||
icon: 'IconTag',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedViewFieldMetadataIds.ViewSorts,
|
||||
@ -176,6 +184,7 @@ export const seedViewFieldMetadata = async (
|
||||
icon: 'IconArrowsSort',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedViewFieldMetadataIds.ViewFilters,
|
||||
@ -191,6 +200,7 @@ export const seedViewFieldMetadata = async (
|
||||
icon: 'IconFilterBolt',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
])
|
||||
.execute();
|
||||
|
||||
@ -36,6 +36,7 @@ export const seedWebhookFieldMetadata = async (
|
||||
'icon',
|
||||
'isNullable',
|
||||
'isSystem',
|
||||
'defaultValue',
|
||||
])
|
||||
.orIgnore()
|
||||
.values([
|
||||
@ -54,8 +55,9 @@ export const seedWebhookFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'uuid' },
|
||||
},
|
||||
{
|
||||
id: SeedWebhookFieldMetadataIds.CreatedAt,
|
||||
@ -71,8 +73,9 @@ export const seedWebhookFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
{
|
||||
id: SeedWebhookFieldMetadataIds.UpdatedAt,
|
||||
@ -88,8 +91,9 @@ export const seedWebhookFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
// Scalar fields
|
||||
{
|
||||
@ -108,6 +112,7 @@ export const seedWebhookFieldMetadata = async (
|
||||
icon: 'IconLink',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
id: SeedWebhookFieldMetadataIds.Operation,
|
||||
@ -125,6 +130,7 @@ export const seedWebhookFieldMetadata = async (
|
||||
icon: 'IconCheckbox',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
])
|
||||
.execute();
|
||||
|
||||
@ -48,6 +48,7 @@ export const seedWorkspaceMemberFieldMetadata = async (
|
||||
'icon',
|
||||
'isNullable',
|
||||
'isSystem',
|
||||
'defaultValue',
|
||||
])
|
||||
.orIgnore()
|
||||
.values([
|
||||
@ -66,8 +67,9 @@ export const seedWorkspaceMemberFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: undefined,
|
||||
isNullable: true,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'uuid' },
|
||||
},
|
||||
{
|
||||
id: SeedWorkspaceMemberFieldMetadataIds.CreatedAt,
|
||||
@ -83,8 +85,9 @@ export const seedWorkspaceMemberFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
{
|
||||
id: SeedWorkspaceMemberFieldMetadataIds.UpdatedAt,
|
||||
@ -100,8 +103,9 @@ export const seedWorkspaceMemberFieldMetadata = async (
|
||||
},
|
||||
description: undefined,
|
||||
icon: 'IconCalendar',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
// Scalar fields
|
||||
{
|
||||
@ -120,6 +124,7 @@ export const seedWorkspaceMemberFieldMetadata = async (
|
||||
icon: 'IconCircleUser',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
id: SeedWorkspaceMemberFieldMetadataIds.LastName,
|
||||
@ -137,6 +142,7 @@ export const seedWorkspaceMemberFieldMetadata = async (
|
||||
icon: 'IconCircleUser',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
id: SeedWorkspaceMemberFieldMetadataIds.AvatarUrl,
|
||||
@ -154,6 +160,7 @@ export const seedWorkspaceMemberFieldMetadata = async (
|
||||
icon: 'IconFileUpload',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedWorkspaceMemberFieldMetadataIds.UserId,
|
||||
@ -171,6 +178,7 @@ export const seedWorkspaceMemberFieldMetadata = async (
|
||||
icon: 'IconCircleUsers',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedWorkspaceMemberFieldMetadataIds.AllowImpersonation,
|
||||
@ -188,6 +196,7 @@ export const seedWorkspaceMemberFieldMetadata = async (
|
||||
icon: 'IconEye',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: false },
|
||||
},
|
||||
{
|
||||
id: SeedWorkspaceMemberFieldMetadataIds.ColorScheme,
|
||||
@ -205,6 +214,7 @@ export const seedWorkspaceMemberFieldMetadata = async (
|
||||
icon: 'IconColorSwatch',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedWorkspaceMemberFieldMetadataIds.Locale,
|
||||
@ -222,6 +232,7 @@ export const seedWorkspaceMemberFieldMetadata = async (
|
||||
icon: 'IconLanguage',
|
||||
isNullable: false,
|
||||
isSystem: false,
|
||||
defaultValue: { value: 'fr' },
|
||||
},
|
||||
|
||||
// Relationships
|
||||
@ -239,6 +250,7 @@ export const seedWorkspaceMemberFieldMetadata = async (
|
||||
icon: 'IconCheckbox',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedWorkspaceMemberFieldMetadataIds.AssignedActivities,
|
||||
@ -254,6 +266,7 @@ export const seedWorkspaceMemberFieldMetadata = async (
|
||||
icon: 'IconCheckbox',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedWorkspaceMemberFieldMetadataIds.Favorites,
|
||||
@ -269,6 +282,7 @@ export const seedWorkspaceMemberFieldMetadata = async (
|
||||
icon: 'IconHeart',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedWorkspaceMemberFieldMetadataIds.AccountOwnerForCompanies,
|
||||
@ -284,6 +298,7 @@ export const seedWorkspaceMemberFieldMetadata = async (
|
||||
icon: 'IconBriefcase',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedWorkspaceMemberFieldMetadataIds.AuthoredAttachments,
|
||||
@ -299,6 +314,7 @@ export const seedWorkspaceMemberFieldMetadata = async (
|
||||
icon: 'IconFileImport',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
id: SeedWorkspaceMemberFieldMetadataIds.AuthoredComments,
|
||||
@ -314,6 +330,7 @@ export const seedWorkspaceMemberFieldMetadata = async (
|
||||
icon: 'IconComment',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
])
|
||||
.execute();
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class SetupMetadataTables1700133603735 implements MigrationInterface {
|
||||
name = 'SetupMetadataTables1700133603735'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`CREATE TABLE "metadata"."relationMetadata" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "relationType" character varying NOT NULL, "fromObjectMetadataId" uuid NOT NULL, "toObjectMetadataId" uuid NOT NULL, "fromFieldMetadataId" uuid NOT NULL, "toFieldMetadataId" uuid NOT NULL, "workspaceId" character varying NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "REL_3deb257254145a3bdde9575e7d" UNIQUE ("fromFieldMetadataId"), CONSTRAINT "REL_9dea8f90d04edbbf9c541a95c3" UNIQUE ("toFieldMetadataId"), CONSTRAINT "PK_2724f60cb4f17a89481a7e8d7d3" PRIMARY KEY ("id"))`);
|
||||
await queryRunner.query(`CREATE TYPE "metadata"."dataSource_type_enum" AS ENUM('postgres')`);
|
||||
await queryRunner.query(`CREATE TABLE "metadata"."dataSource" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "url" character varying, "schema" character varying, "type" "metadata"."dataSource_type_enum" NOT NULL DEFAULT 'postgres', "label" character varying, "isRemote" boolean NOT NULL DEFAULT false, "workspaceId" character varying NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "PK_6d01ae6c0f47baf4f8e37342268" PRIMARY KEY ("id"))`);
|
||||
await queryRunner.query(`CREATE TABLE "metadata"."objectMetadata" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "dataSourceId" uuid NOT NULL, "nameSingular" character varying NOT NULL, "namePlural" character varying NOT NULL, "labelSingular" character varying NOT NULL, "labelPlural" character varying NOT NULL, "description" text, "icon" character varying, "targetTableName" character varying NOT NULL, "isCustom" boolean NOT NULL DEFAULT false, "isActive" boolean NOT NULL DEFAULT false, "isSystem" boolean NOT NULL DEFAULT false, "workspaceId" character varying NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "IndexOnNamePluralAndWorkspaceIdUnique" UNIQUE ("namePlural", "workspaceId"), CONSTRAINT "IndexOnNameSingularAndWorkspaceIdUnique" UNIQUE ("nameSingular", "workspaceId"), CONSTRAINT "PK_81fb7f4f4244211cfbd188af1e8" PRIMARY KEY ("id"))`);
|
||||
await queryRunner.query(`CREATE TABLE "metadata"."fieldMetadata" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "objectMetadataId" uuid NOT NULL, "type" character varying NOT NULL, "name" character varying NOT NULL, "label" character varying NOT NULL, "targetColumnMap" jsonb NOT NULL, "description" text, "icon" character varying, "enums" text array, "isCustom" boolean NOT NULL DEFAULT false, "isActive" boolean NOT NULL DEFAULT false, "isSystem" boolean NOT NULL DEFAULT false, "isNullable" boolean DEFAULT true, "workspaceId" character varying NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "IndexOnNameObjectMetadataIdAndWorkspaceIdUnique" UNIQUE ("name", "objectMetadataId", "workspaceId"), CONSTRAINT "PK_d046b1c7cea325ebc4cdc25e7a9" PRIMARY KEY ("id"))`);
|
||||
await queryRunner.query(`CREATE TABLE "metadata"."tenantMigration" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "migrations" jsonb, "name" character varying, "isCustom" boolean NOT NULL DEFAULT false, "appliedAt" TIMESTAMP, "workspaceId" character varying NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "PK_f9b06eb42494795f73acb5c2350" PRIMARY KEY ("id"))`);
|
||||
await queryRunner.query(`ALTER TABLE "metadata"."relationMetadata" ADD CONSTRAINT "FK_f2a0acd3a548ee446a1a35df44d" FOREIGN KEY ("fromObjectMetadataId") REFERENCES "metadata"."objectMetadata"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
||||
await queryRunner.query(`ALTER TABLE "metadata"."relationMetadata" ADD CONSTRAINT "FK_0f781f589e5a527b8f3d3a4b824" FOREIGN KEY ("toObjectMetadataId") REFERENCES "metadata"."objectMetadata"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
||||
await queryRunner.query(`ALTER TABLE "metadata"."relationMetadata" ADD CONSTRAINT "FK_3deb257254145a3bdde9575e7d6" FOREIGN KEY ("fromFieldMetadataId") REFERENCES "metadata"."fieldMetadata"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
||||
await queryRunner.query(`ALTER TABLE "metadata"."relationMetadata" ADD CONSTRAINT "FK_9dea8f90d04edbbf9c541a95c3b" FOREIGN KEY ("toFieldMetadataId") REFERENCES "metadata"."fieldMetadata"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
||||
await queryRunner.query(`ALTER TABLE "metadata"."objectMetadata" ADD CONSTRAINT "FK_0b19dd17369574578bc18c405b2" FOREIGN KEY ("dataSourceId") REFERENCES "metadata"."dataSource"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
||||
await queryRunner.query(`ALTER TABLE "metadata"."fieldMetadata" ADD CONSTRAINT "FK_de2a09b9e3e690440480d2dee26" FOREIGN KEY ("objectMetadataId") REFERENCES "metadata"."objectMetadata"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "metadata"."fieldMetadata" DROP CONSTRAINT "FK_de2a09b9e3e690440480d2dee26"`);
|
||||
await queryRunner.query(`ALTER TABLE "metadata"."objectMetadata" DROP CONSTRAINT "FK_0b19dd17369574578bc18c405b2"`);
|
||||
await queryRunner.query(`ALTER TABLE "metadata"."relationMetadata" DROP CONSTRAINT "FK_9dea8f90d04edbbf9c541a95c3b"`);
|
||||
await queryRunner.query(`ALTER TABLE "metadata"."relationMetadata" DROP CONSTRAINT "FK_3deb257254145a3bdde9575e7d6"`);
|
||||
await queryRunner.query(`ALTER TABLE "metadata"."relationMetadata" DROP CONSTRAINT "FK_0f781f589e5a527b8f3d3a4b824"`);
|
||||
await queryRunner.query(`ALTER TABLE "metadata"."relationMetadata" DROP CONSTRAINT "FK_f2a0acd3a548ee446a1a35df44d"`);
|
||||
await queryRunner.query(`DROP TABLE "metadata"."tenantMigration"`);
|
||||
await queryRunner.query(`DROP TABLE "metadata"."fieldMetadata"`);
|
||||
await queryRunner.query(`DROP TABLE "metadata"."objectMetadata"`);
|
||||
await queryRunner.query(`DROP TABLE "metadata"."dataSource"`);
|
||||
await queryRunner.query(`DROP TYPE "metadata"."dataSource_type_enum"`);
|
||||
await queryRunner.query(`DROP TABLE "metadata"."relationMetadata"`);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class SetupMetadataTables1700140427984 implements MigrationInterface {
|
||||
name = 'SetupMetadataTables1700140427984';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE "metadata"."relationMetadata" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "relationType" character varying NOT NULL, "fromObjectMetadataId" uuid NOT NULL, "toObjectMetadataId" uuid NOT NULL, "fromFieldMetadataId" uuid NOT NULL, "toFieldMetadataId" uuid NOT NULL, "workspaceId" character varying NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "REL_3deb257254145a3bdde9575e7d" UNIQUE ("fromFieldMetadataId"), CONSTRAINT "REL_9dea8f90d04edbbf9c541a95c3" UNIQUE ("toFieldMetadataId"), CONSTRAINT "PK_2724f60cb4f17a89481a7e8d7d3" PRIMARY KEY ("id"))`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE "metadata"."fieldMetadata" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "objectMetadataId" uuid NOT NULL, "type" character varying NOT NULL, "name" character varying NOT NULL, "label" character varying NOT NULL, "targetColumnMap" jsonb NOT NULL, "defaultValue" jsonb, "description" text, "icon" character varying, "enums" text array, "isCustom" boolean NOT NULL DEFAULT false, "isActive" boolean NOT NULL DEFAULT false, "isSystem" boolean NOT NULL DEFAULT false, "isNullable" boolean DEFAULT true, "workspaceId" character varying NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "IndexOnNameObjectMetadataIdAndWorkspaceIdUnique" UNIQUE ("name", "objectMetadataId", "workspaceId"), CONSTRAINT "PK_d046b1c7cea325ebc4cdc25e7a9" PRIMARY KEY ("id"))`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE "metadata"."objectMetadata" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "dataSourceId" uuid NOT NULL, "nameSingular" character varying NOT NULL, "namePlural" character varying NOT NULL, "labelSingular" character varying NOT NULL, "labelPlural" character varying NOT NULL, "description" text, "icon" character varying, "targetTableName" character varying NOT NULL, "isCustom" boolean NOT NULL DEFAULT false, "isActive" boolean NOT NULL DEFAULT false, "isSystem" boolean NOT NULL DEFAULT false, "workspaceId" character varying NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "IndexOnNamePluralAndWorkspaceIdUnique" UNIQUE ("namePlural", "workspaceId"), CONSTRAINT "IndexOnNameSingularAndWorkspaceIdUnique" UNIQUE ("nameSingular", "workspaceId"), CONSTRAINT "PK_81fb7f4f4244211cfbd188af1e8" PRIMARY KEY ("id"))`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`CREATE TYPE "metadata"."dataSource_type_enum" AS ENUM('postgres')`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE "metadata"."dataSource" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "url" character varying, "schema" character varying, "type" "metadata"."dataSource_type_enum" NOT NULL DEFAULT 'postgres', "label" character varying, "isRemote" boolean NOT NULL DEFAULT false, "workspaceId" character varying NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "PK_6d01ae6c0f47baf4f8e37342268" PRIMARY KEY ("id"))`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE "metadata"."tenantMigration" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "migrations" jsonb, "name" character varying, "isCustom" boolean NOT NULL DEFAULT false, "appliedAt" TIMESTAMP, "workspaceId" character varying NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "PK_f9b06eb42494795f73acb5c2350" PRIMARY KEY ("id"))`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."relationMetadata" ADD CONSTRAINT "FK_f2a0acd3a548ee446a1a35df44d" FOREIGN KEY ("fromObjectMetadataId") REFERENCES "metadata"."objectMetadata"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."relationMetadata" ADD CONSTRAINT "FK_0f781f589e5a527b8f3d3a4b824" FOREIGN KEY ("toObjectMetadataId") REFERENCES "metadata"."objectMetadata"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."relationMetadata" ADD CONSTRAINT "FK_3deb257254145a3bdde9575e7d6" FOREIGN KEY ("fromFieldMetadataId") REFERENCES "metadata"."fieldMetadata"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."relationMetadata" ADD CONSTRAINT "FK_9dea8f90d04edbbf9c541a95c3b" FOREIGN KEY ("toFieldMetadataId") REFERENCES "metadata"."fieldMetadata"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."fieldMetadata" ADD CONSTRAINT "FK_de2a09b9e3e690440480d2dee26" FOREIGN KEY ("objectMetadataId") REFERENCES "metadata"."objectMetadata"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."objectMetadata" ADD CONSTRAINT "FK_0b19dd17369574578bc18c405b2" FOREIGN KEY ("dataSourceId") REFERENCES "metadata"."dataSource"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."objectMetadata" DROP CONSTRAINT "FK_0b19dd17369574578bc18c405b2"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."fieldMetadata" DROP CONSTRAINT "FK_de2a09b9e3e690440480d2dee26"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."relationMetadata" DROP CONSTRAINT "FK_9dea8f90d04edbbf9c541a95c3b"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."relationMetadata" DROP CONSTRAINT "FK_3deb257254145a3bdde9575e7d6"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."relationMetadata" DROP CONSTRAINT "FK_0f781f589e5a527b8f3d3a4b824"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."relationMetadata" DROP CONSTRAINT "FK_f2a0acd3a548ee446a1a35df44d"`,
|
||||
);
|
||||
await queryRunner.query(`DROP TABLE "metadata"."tenantMigration"`);
|
||||
await queryRunner.query(`DROP TABLE "metadata"."dataSource"`);
|
||||
await queryRunner.query(`DROP TYPE "metadata"."dataSource_type_enum"`);
|
||||
await queryRunner.query(`DROP TABLE "metadata"."objectMetadata"`);
|
||||
await queryRunner.query(`DROP TABLE "metadata"."fieldMetadata"`);
|
||||
await queryRunner.query(`DROP TABLE "metadata"."relationMetadata"`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user