Documentation ¶
Index ¶
- Variables
- func Create(ctx context.Context, s *Schema, tables []*schema.Table, ...) error
- func Diff(ctx context.Context, url string, opts ...schema.MigrateOption) error
- func NamedDiff(ctx context.Context, url, name string, opts ...schema.MigrateOption) error
- type Schema
- func (s *Schema) Create(ctx context.Context, opts ...schema.MigrateOption) error
- func (s *Schema) Diff(ctx context.Context, opts ...schema.MigrateOption) error
- func (s *Schema) NamedDiff(ctx context.Context, name string, opts ...schema.MigrateOption) error
- func (s *Schema) WriteTo(ctx context.Context, w io.Writer, opts ...schema.MigrateOption) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // WithGlobalUniqueID sets the universal ids options to the migration. // If this option is enabled, ent migration will allocate a 1<<32 range // for the ids of each entity (table). // Note that this option cannot be applied on tables that already exist. WithGlobalUniqueID = schema.WithGlobalUniqueID // WithDropColumn sets the drop column option to the migration. // If this option is enabled, ent migration will drop old columns // that were used for both fields and edges. This defaults to false. WithDropColumn = schema.WithDropColumn // WithDropIndex sets the drop index option to the migration. // If this option is enabled, ent migration will drop old indexes // that were defined in the schema. This defaults to false. // Note that unique constraints are defined using `UNIQUE INDEX`, // and therefore, it's recommended to enable this option to get more // flexibility in the schema changes. WithDropIndex = schema.WithDropIndex // WithForeignKeys enables creating foreign-key in schema DDL. This defaults to true. WithForeignKeys = schema.WithForeignKeys )
View Source
var ( // APITokensColumns holds the columns for the "api_tokens" table. APITokensColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "token", Type: field.TypeString, Unique: true}, {Name: "expires_at", Type: field.TypeTime, Nullable: true}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "scopes", Type: field.TypeJSON, Nullable: true}, {Name: "last_used_at", Type: field.TypeTime, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, } // APITokensTable holds the schema information for the "api_tokens" table. APITokensTable = &schema.Table{ Name: "api_tokens", Columns: APITokensColumns, PrimaryKey: []*schema.Column{APITokensColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "api_tokens_organizations_api_tokens", Columns: []*schema.Column{APITokensColumns[15]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "apitoken_token", Unique: false, Columns: []*schema.Column{APITokensColumns[10]}, }, }, } // ActionPlansColumns holds the columns for the "action_plans" table. ActionPlansColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "status", Type: field.TypeString, Nullable: true}, {Name: "due_date", Type: field.TypeTime, Nullable: true}, {Name: "priority", Type: field.TypeString, Nullable: true}, {Name: "source", Type: field.TypeString, Nullable: true}, {Name: "details", Type: field.TypeJSON, Nullable: true}, } // ActionPlansTable holds the schema information for the "action_plans" table. ActionPlansTable = &schema.Table{ Name: "action_plans", Columns: ActionPlansColumns, PrimaryKey: []*schema.Column{ActionPlansColumns[0]}, } // ActionPlanHistoryColumns holds the columns for the "action_plan_history" table. ActionPlanHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "status", Type: field.TypeString, Nullable: true}, {Name: "due_date", Type: field.TypeTime, Nullable: true}, {Name: "priority", Type: field.TypeString, Nullable: true}, {Name: "source", Type: field.TypeString, Nullable: true}, {Name: "details", Type: field.TypeJSON, Nullable: true}, } // ActionPlanHistoryTable holds the schema information for the "action_plan_history" table. ActionPlanHistoryTable = &schema.Table{ Name: "action_plan_history", Columns: ActionPlanHistoryColumns, PrimaryKey: []*schema.Column{ActionPlanHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "actionplanhistory_history_time", Unique: false, Columns: []*schema.Column{ActionPlanHistoryColumns[1]}, }, }, } // ContactsColumns holds the columns for the "contacts" table. ContactsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "full_name", Type: field.TypeString, Size: 64}, {Name: "title", Type: field.TypeString, Nullable: true}, {Name: "company", Type: field.TypeString, Nullable: true}, {Name: "email", Type: field.TypeString, Nullable: true}, {Name: "phone_number", Type: field.TypeString, Nullable: true}, {Name: "address", Type: field.TypeString, Nullable: true}, {Name: "status", Type: field.TypeEnum, Enums: []string{"ACTIVE", "INACTIVE", "DEACTIVATED", "SUSPENDED", "ONBOARDING"}, Default: "ACTIVE"}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, } // ContactsTable holds the schema information for the "contacts" table. ContactsTable = &schema.Table{ Name: "contacts", Columns: ContactsColumns, PrimaryKey: []*schema.Column{ContactsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "contacts_organizations_contacts", Columns: []*schema.Column{ContactsColumns[16]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.SetNull, }, }, } // ContactHistoryColumns holds the columns for the "contact_history" table. ContactHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, {Name: "full_name", Type: field.TypeString, Size: 64}, {Name: "title", Type: field.TypeString, Nullable: true}, {Name: "company", Type: field.TypeString, Nullable: true}, {Name: "email", Type: field.TypeString, Nullable: true}, {Name: "phone_number", Type: field.TypeString, Nullable: true}, {Name: "address", Type: field.TypeString, Nullable: true}, {Name: "status", Type: field.TypeEnum, Enums: []string{"ACTIVE", "INACTIVE", "DEACTIVATED", "SUSPENDED", "ONBOARDING"}, Default: "ACTIVE"}, } // ContactHistoryTable holds the schema information for the "contact_history" table. ContactHistoryTable = &schema.Table{ Name: "contact_history", Columns: ContactHistoryColumns, PrimaryKey: []*schema.Column{ContactHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "contacthistory_history_time", Unique: false, Columns: []*schema.Column{ContactHistoryColumns[1]}, }, }, } // ControlsColumns holds the columns for the "controls" table. ControlsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "status", Type: field.TypeString, Nullable: true}, {Name: "control_type", Type: field.TypeString, Nullable: true}, {Name: "version", Type: field.TypeString, Nullable: true}, {Name: "control_number", Type: field.TypeString, Nullable: true}, {Name: "family", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "class", Type: field.TypeString, Nullable: true}, {Name: "source", Type: field.TypeString, Nullable: true}, {Name: "satisfies", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "mapped_frameworks", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "details", Type: field.TypeJSON, Nullable: true}, {Name: "control_objective_controls", Type: field.TypeString, Nullable: true}, {Name: "internal_policy_controls", Type: field.TypeString, Nullable: true}, {Name: "owner_id", Type: field.TypeString}, } // ControlsTable holds the schema information for the "controls" table. ControlsTable = &schema.Table{ Name: "controls", Columns: ControlsColumns, PrimaryKey: []*schema.Column{ControlsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "controls_control_objectives_controls", Columns: []*schema.Column{ControlsColumns[21]}, RefColumns: []*schema.Column{ControlObjectivesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "controls_internal_policies_controls", Columns: []*schema.Column{ControlsColumns[22]}, RefColumns: []*schema.Column{InternalPoliciesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "controls_organizations_controls", Columns: []*schema.Column{ControlsColumns[23]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, }, } // ControlHistoryColumns holds the columns for the "control_history" table. ControlHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "owner_id", Type: field.TypeString}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "status", Type: field.TypeString, Nullable: true}, {Name: "control_type", Type: field.TypeString, Nullable: true}, {Name: "version", Type: field.TypeString, Nullable: true}, {Name: "control_number", Type: field.TypeString, Nullable: true}, {Name: "family", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "class", Type: field.TypeString, Nullable: true}, {Name: "source", Type: field.TypeString, Nullable: true}, {Name: "satisfies", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "mapped_frameworks", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "details", Type: field.TypeJSON, Nullable: true}, } // ControlHistoryTable holds the schema information for the "control_history" table. ControlHistoryTable = &schema.Table{ Name: "control_history", Columns: ControlHistoryColumns, PrimaryKey: []*schema.Column{ControlHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "controlhistory_history_time", Unique: false, Columns: []*schema.Column{ControlHistoryColumns[1]}, }, }, } // ControlObjectivesColumns holds the columns for the "control_objectives" table. ControlObjectivesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "status", Type: field.TypeString, Nullable: true}, {Name: "control_objective_type", Type: field.TypeString, Nullable: true}, {Name: "version", Type: field.TypeString, Nullable: true}, {Name: "control_number", Type: field.TypeString, Nullable: true}, {Name: "family", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "class", Type: field.TypeString, Nullable: true}, {Name: "source", Type: field.TypeString, Nullable: true}, {Name: "mapped_frameworks", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "details", Type: field.TypeJSON, Nullable: true}, {Name: "control_control_objectives", Type: field.TypeString, Nullable: true}, {Name: "owner_id", Type: field.TypeString}, } // ControlObjectivesTable holds the schema information for the "control_objectives" table. ControlObjectivesTable = &schema.Table{ Name: "control_objectives", Columns: ControlObjectivesColumns, PrimaryKey: []*schema.Column{ControlObjectivesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "control_objectives_controls_control_objectives", Columns: []*schema.Column{ControlObjectivesColumns[20]}, RefColumns: []*schema.Column{ControlsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "control_objectives_organizations_control_objectives", Columns: []*schema.Column{ControlObjectivesColumns[21]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, }, } // ControlObjectiveHistoryColumns holds the columns for the "control_objective_history" table. ControlObjectiveHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "owner_id", Type: field.TypeString}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "status", Type: field.TypeString, Nullable: true}, {Name: "control_objective_type", Type: field.TypeString, Nullable: true}, {Name: "version", Type: field.TypeString, Nullable: true}, {Name: "control_number", Type: field.TypeString, Nullable: true}, {Name: "family", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "class", Type: field.TypeString, Nullable: true}, {Name: "source", Type: field.TypeString, Nullable: true}, {Name: "mapped_frameworks", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "details", Type: field.TypeJSON, Nullable: true}, } // ControlObjectiveHistoryTable holds the schema information for the "control_objective_history" table. ControlObjectiveHistoryTable = &schema.Table{ Name: "control_objective_history", Columns: ControlObjectiveHistoryColumns, PrimaryKey: []*schema.Column{ControlObjectiveHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "controlobjectivehistory_history_time", Unique: false, Columns: []*schema.Column{ControlObjectiveHistoryColumns[1]}, }, }, } // DocumentDataColumns holds the columns for the "document_data" table. DocumentDataColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "data", Type: field.TypeJSON}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, {Name: "template_id", Type: field.TypeString}, } // DocumentDataTable holds the schema information for the "document_data" table. DocumentDataTable = &schema.Table{ Name: "document_data", Columns: DocumentDataColumns, PrimaryKey: []*schema.Column{DocumentDataColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "document_data_organizations_document_data", Columns: []*schema.Column{DocumentDataColumns[10]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "document_data_templates_documents", Columns: []*schema.Column{DocumentDataColumns[11]}, RefColumns: []*schema.Column{TemplatesColumns[0]}, OnDelete: schema.NoAction, }, }, } // DocumentDataHistoryColumns holds the columns for the "document_data_history" table. DocumentDataHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, {Name: "template_id", Type: field.TypeString}, {Name: "data", Type: field.TypeJSON}, } // DocumentDataHistoryTable holds the schema information for the "document_data_history" table. DocumentDataHistoryTable = &schema.Table{ Name: "document_data_history", Columns: DocumentDataHistoryColumns, PrimaryKey: []*schema.Column{DocumentDataHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "documentdatahistory_history_time", Unique: false, Columns: []*schema.Column{DocumentDataHistoryColumns[1]}, }, }, } // EmailVerificationTokensColumns holds the columns for the "email_verification_tokens" table. EmailVerificationTokensColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "token", Type: field.TypeString, Unique: true}, {Name: "ttl", Type: field.TypeTime}, {Name: "email", Type: field.TypeString}, {Name: "secret", Type: field.TypeBytes}, {Name: "owner_id", Type: field.TypeString}, } // EmailVerificationTokensTable holds the schema information for the "email_verification_tokens" table. EmailVerificationTokensTable = &schema.Table{ Name: "email_verification_tokens", Columns: EmailVerificationTokensColumns, PrimaryKey: []*schema.Column{EmailVerificationTokensColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "email_verification_tokens_users_email_verification_tokens", Columns: []*schema.Column{EmailVerificationTokensColumns[12]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "emailverificationtoken_token", Unique: true, Columns: []*schema.Column{EmailVerificationTokensColumns[8]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at is NULL", }, }, }, } // EntitiesColumns holds the columns for the "entities" table. EntitiesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "name", Type: field.TypeString, Nullable: true, Size: 160}, {Name: "display_name", Type: field.TypeString, Nullable: true, Size: 64}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "domains", Type: field.TypeJSON, Nullable: true}, {Name: "status", Type: field.TypeString, Nullable: true, Default: "active"}, {Name: "entity_type_id", Type: field.TypeString, Nullable: true}, {Name: "entity_type_entities", Type: field.TypeString, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, } // EntitiesTable holds the schema information for the "entities" table. EntitiesTable = &schema.Table{ Name: "entities", Columns: EntitiesColumns, PrimaryKey: []*schema.Column{EntitiesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "entities_entity_types_entity_type", Columns: []*schema.Column{EntitiesColumns[14]}, RefColumns: []*schema.Column{EntityTypesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "entities_entity_types_entities", Columns: []*schema.Column{EntitiesColumns[15]}, RefColumns: []*schema.Column{EntityTypesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "entities_organizations_entities", Columns: []*schema.Column{EntitiesColumns[16]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "entity_name_owner_id", Unique: true, Columns: []*schema.Column{EntitiesColumns[9], EntitiesColumns[16]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at is NULL", }, }, }, } // EntityHistoryColumns holds the columns for the "entity_history" table. EntityHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, {Name: "name", Type: field.TypeString, Nullable: true, Size: 160}, {Name: "display_name", Type: field.TypeString, Nullable: true, Size: 64}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "domains", Type: field.TypeJSON, Nullable: true}, {Name: "entity_type_id", Type: field.TypeString, Nullable: true}, {Name: "status", Type: field.TypeString, Nullable: true, Default: "active"}, } // EntityHistoryTable holds the schema information for the "entity_history" table. EntityHistoryTable = &schema.Table{ Name: "entity_history", Columns: EntityHistoryColumns, PrimaryKey: []*schema.Column{EntityHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "entityhistory_history_time", Unique: false, Columns: []*schema.Column{EntityHistoryColumns[1]}, }, }, } // EntityTypesColumns holds the columns for the "entity_types" table. EntityTypesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "name", Type: field.TypeString, Size: 64}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, } // EntityTypesTable holds the schema information for the "entity_types" table. EntityTypesTable = &schema.Table{ Name: "entity_types", Columns: EntityTypesColumns, PrimaryKey: []*schema.Column{EntityTypesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "entity_types_organizations_entity_types", Columns: []*schema.Column{EntityTypesColumns[10]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "entitytype_name_owner_id", Unique: true, Columns: []*schema.Column{EntityTypesColumns[9], EntityTypesColumns[10]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at is NULL", }, }, }, } // EntityTypeHistoryColumns holds the columns for the "entity_type_history" table. EntityTypeHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, {Name: "name", Type: field.TypeString, Size: 64}, } // EntityTypeHistoryTable holds the schema information for the "entity_type_history" table. EntityTypeHistoryTable = &schema.Table{ Name: "entity_type_history", Columns: EntityTypeHistoryColumns, PrimaryKey: []*schema.Column{EntityTypeHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "entitytypehistory_history_time", Unique: false, Columns: []*schema.Column{EntityTypeHistoryColumns[1]}, }, }, } // EventsColumns holds the columns for the "events" table. EventsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "event_id", Type: field.TypeString, Nullable: true}, {Name: "correlation_id", Type: field.TypeString, Nullable: true}, {Name: "event_type", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true}, } // EventsTable holds the schema information for the "events" table. EventsTable = &schema.Table{ Name: "events", Columns: EventsColumns, PrimaryKey: []*schema.Column{EventsColumns[0]}, } // EventHistoryColumns holds the columns for the "event_history" table. EventHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "event_id", Type: field.TypeString, Nullable: true}, {Name: "correlation_id", Type: field.TypeString, Nullable: true}, {Name: "event_type", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true}, } // EventHistoryTable holds the schema information for the "event_history" table. EventHistoryTable = &schema.Table{ Name: "event_history", Columns: EventHistoryColumns, PrimaryKey: []*schema.Column{EventHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "eventhistory_history_time", Unique: false, Columns: []*schema.Column{EventHistoryColumns[1]}, }, }, } // FilesColumns holds the columns for the "files" table. FilesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "provided_file_name", Type: field.TypeString}, {Name: "provided_file_extension", Type: field.TypeString}, {Name: "provided_file_size", Type: field.TypeInt64, Nullable: true}, {Name: "persisted_file_size", Type: field.TypeInt64, Nullable: true}, {Name: "detected_mime_type", Type: field.TypeString, Nullable: true}, {Name: "md5_hash", Type: field.TypeString, Nullable: true}, {Name: "detected_content_type", Type: field.TypeString}, {Name: "store_key", Type: field.TypeString, Nullable: true}, {Name: "category_type", Type: field.TypeString, Nullable: true}, {Name: "uri", Type: field.TypeString, Nullable: true}, {Name: "storage_scheme", Type: field.TypeString, Nullable: true}, {Name: "storage_volume", Type: field.TypeString, Nullable: true}, {Name: "storage_path", Type: field.TypeString, Nullable: true}, {Name: "file_contents", Type: field.TypeBytes, Nullable: true}, } // FilesTable holds the schema information for the "files" table. FilesTable = &schema.Table{ Name: "files", Columns: FilesColumns, PrimaryKey: []*schema.Column{FilesColumns[0]}, } // FileHistoryColumns holds the columns for the "file_history" table. FileHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "provided_file_name", Type: field.TypeString}, {Name: "provided_file_extension", Type: field.TypeString}, {Name: "provided_file_size", Type: field.TypeInt64, Nullable: true}, {Name: "persisted_file_size", Type: field.TypeInt64, Nullable: true}, {Name: "detected_mime_type", Type: field.TypeString, Nullable: true}, {Name: "md5_hash", Type: field.TypeString, Nullable: true}, {Name: "detected_content_type", Type: field.TypeString}, {Name: "store_key", Type: field.TypeString, Nullable: true}, {Name: "category_type", Type: field.TypeString, Nullable: true}, {Name: "uri", Type: field.TypeString, Nullable: true}, {Name: "storage_scheme", Type: field.TypeString, Nullable: true}, {Name: "storage_volume", Type: field.TypeString, Nullable: true}, {Name: "storage_path", Type: field.TypeString, Nullable: true}, {Name: "file_contents", Type: field.TypeBytes, Nullable: true}, } // FileHistoryTable holds the schema information for the "file_history" table. FileHistoryTable = &schema.Table{ Name: "file_history", Columns: FileHistoryColumns, PrimaryKey: []*schema.Column{FileHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "filehistory_history_time", Unique: false, Columns: []*schema.Column{FileHistoryColumns[1]}, }, }, } // GroupsColumns holds the columns for the "groups" table. GroupsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "gravatar_logo_url", Type: field.TypeString, Nullable: true}, {Name: "logo_url", Type: field.TypeString, Nullable: true}, {Name: "display_name", Type: field.TypeString, Size: 64, Default: ""}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, } // GroupsTable holds the schema information for the "groups" table. GroupsTable = &schema.Table{ Name: "groups", Columns: GroupsColumns, PrimaryKey: []*schema.Column{GroupsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "groups_organizations_groups", Columns: []*schema.Column{GroupsColumns[14]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "group_name_owner_id", Unique: true, Columns: []*schema.Column{GroupsColumns[9], GroupsColumns[14]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at is NULL", }, }, }, } // GroupHistoryColumns holds the columns for the "group_history" table. GroupHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "gravatar_logo_url", Type: field.TypeString, Nullable: true}, {Name: "logo_url", Type: field.TypeString, Nullable: true}, {Name: "display_name", Type: field.TypeString, Size: 64, Default: ""}, } // GroupHistoryTable holds the schema information for the "group_history" table. GroupHistoryTable = &schema.Table{ Name: "group_history", Columns: GroupHistoryColumns, PrimaryKey: []*schema.Column{GroupHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "grouphistory_history_time", Unique: false, Columns: []*schema.Column{GroupHistoryColumns[1]}, }, }, } // GroupMembershipsColumns holds the columns for the "group_memberships" table. GroupMembershipsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "role", Type: field.TypeEnum, Enums: []string{"ADMIN", "MEMBER"}, Default: "MEMBER"}, {Name: "group_id", Type: field.TypeString}, {Name: "user_id", Type: field.TypeString}, } // GroupMembershipsTable holds the schema information for the "group_memberships" table. GroupMembershipsTable = &schema.Table{ Name: "group_memberships", Columns: GroupMembershipsColumns, PrimaryKey: []*schema.Column{GroupMembershipsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "group_memberships_groups_group", Columns: []*schema.Column{GroupMembershipsColumns[9]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "group_memberships_users_user", Columns: []*schema.Column{GroupMembershipsColumns[10]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "groupmembership_user_id_group_id", Unique: true, Columns: []*schema.Column{GroupMembershipsColumns[10], GroupMembershipsColumns[9]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at is NULL", }, }, }, } // GroupMembershipHistoryColumns holds the columns for the "group_membership_history" table. GroupMembershipHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "role", Type: field.TypeEnum, Enums: []string{"ADMIN", "MEMBER"}, Default: "MEMBER"}, {Name: "group_id", Type: field.TypeString}, {Name: "user_id", Type: field.TypeString}, } // GroupMembershipHistoryTable holds the schema information for the "group_membership_history" table. GroupMembershipHistoryTable = &schema.Table{ Name: "group_membership_history", Columns: GroupMembershipHistoryColumns, PrimaryKey: []*schema.Column{GroupMembershipHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "groupmembershiphistory_history_time", Unique: false, Columns: []*schema.Column{GroupMembershipHistoryColumns[1]}, }, }, } // GroupSettingsColumns holds the columns for the "group_settings" table. GroupSettingsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "visibility", Type: field.TypeEnum, Enums: []string{"PUBLIC", "PRIVATE"}, Default: "PUBLIC"}, {Name: "join_policy", Type: field.TypeEnum, Enums: []string{"OPEN", "INVITE_ONLY", "APPLICATION_ONLY", "INVITE_OR_APPLICATION"}, Default: "INVITE_OR_APPLICATION"}, {Name: "sync_to_slack", Type: field.TypeBool, Nullable: true, Default: false}, {Name: "sync_to_github", Type: field.TypeBool, Nullable: true, Default: false}, {Name: "group_id", Type: field.TypeString, Unique: true, Nullable: true}, } // GroupSettingsTable holds the schema information for the "group_settings" table. GroupSettingsTable = &schema.Table{ Name: "group_settings", Columns: GroupSettingsColumns, PrimaryKey: []*schema.Column{GroupSettingsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "group_settings_groups_setting", Columns: []*schema.Column{GroupSettingsColumns[13]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.SetNull, }, }, } // GroupSettingHistoryColumns holds the columns for the "group_setting_history" table. GroupSettingHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "visibility", Type: field.TypeEnum, Enums: []string{"PUBLIC", "PRIVATE"}, Default: "PUBLIC"}, {Name: "join_policy", Type: field.TypeEnum, Enums: []string{"OPEN", "INVITE_ONLY", "APPLICATION_ONLY", "INVITE_OR_APPLICATION"}, Default: "INVITE_OR_APPLICATION"}, {Name: "sync_to_slack", Type: field.TypeBool, Nullable: true, Default: false}, {Name: "sync_to_github", Type: field.TypeBool, Nullable: true, Default: false}, {Name: "group_id", Type: field.TypeString, Nullable: true}, } // GroupSettingHistoryTable holds the schema information for the "group_setting_history" table. GroupSettingHistoryTable = &schema.Table{ Name: "group_setting_history", Columns: GroupSettingHistoryColumns, PrimaryKey: []*schema.Column{GroupSettingHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "groupsettinghistory_history_time", Unique: false, Columns: []*schema.Column{GroupSettingHistoryColumns[1]}, }, }, } // HushesColumns holds the columns for the "hushes" table. HushesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "kind", Type: field.TypeString, Nullable: true}, {Name: "secret_name", Type: field.TypeString, Nullable: true}, {Name: "secret_value", Type: field.TypeString, Nullable: true}, } // HushesTable holds the schema information for the "hushes" table. HushesTable = &schema.Table{ Name: "hushes", Columns: HushesColumns, PrimaryKey: []*schema.Column{HushesColumns[0]}, } // HushHistoryColumns holds the columns for the "hush_history" table. HushHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "kind", Type: field.TypeString, Nullable: true}, {Name: "secret_name", Type: field.TypeString, Nullable: true}, {Name: "secret_value", Type: field.TypeString, Nullable: true}, } // HushHistoryTable holds the schema information for the "hush_history" table. HushHistoryTable = &schema.Table{ Name: "hush_history", Columns: HushHistoryColumns, PrimaryKey: []*schema.Column{HushHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "hushhistory_history_time", Unique: false, Columns: []*schema.Column{HushHistoryColumns[1]}, }, }, } // IntegrationsColumns holds the columns for the "integrations" table. IntegrationsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "kind", Type: field.TypeString, Nullable: true}, {Name: "group_integrations", Type: field.TypeString, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, } // IntegrationsTable holds the schema information for the "integrations" table. IntegrationsTable = &schema.Table{ Name: "integrations", Columns: IntegrationsColumns, PrimaryKey: []*schema.Column{IntegrationsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "integrations_groups_integrations", Columns: []*schema.Column{IntegrationsColumns[12]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "integrations_organizations_integrations", Columns: []*schema.Column{IntegrationsColumns[13]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.SetNull, }, }, } // IntegrationHistoryColumns holds the columns for the "integration_history" table. IntegrationHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "kind", Type: field.TypeString, Nullable: true}, } // IntegrationHistoryTable holds the schema information for the "integration_history" table. IntegrationHistoryTable = &schema.Table{ Name: "integration_history", Columns: IntegrationHistoryColumns, PrimaryKey: []*schema.Column{IntegrationHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "integrationhistory_history_time", Unique: false, Columns: []*schema.Column{IntegrationHistoryColumns[1]}, }, }, } // InternalPoliciesColumns holds the columns for the "internal_policies" table. InternalPoliciesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "status", Type: field.TypeString, Nullable: true}, {Name: "policy_type", Type: field.TypeString, Nullable: true}, {Name: "version", Type: field.TypeString, Nullable: true}, {Name: "purpose_and_scope", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "background", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "details", Type: field.TypeJSON, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, } // InternalPoliciesTable holds the schema information for the "internal_policies" table. InternalPoliciesTable = &schema.Table{ Name: "internal_policies", Columns: InternalPoliciesColumns, PrimaryKey: []*schema.Column{InternalPoliciesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "internal_policies_organizations_internal_policies", Columns: []*schema.Column{InternalPoliciesColumns[17]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.SetNull, }, }, } // InternalPolicyHistoryColumns holds the columns for the "internal_policy_history" table. InternalPolicyHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "status", Type: field.TypeString, Nullable: true}, {Name: "policy_type", Type: field.TypeString, Nullable: true}, {Name: "version", Type: field.TypeString, Nullable: true}, {Name: "purpose_and_scope", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "background", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "details", Type: field.TypeJSON, Nullable: true}, } // InternalPolicyHistoryTable holds the schema information for the "internal_policy_history" table. InternalPolicyHistoryTable = &schema.Table{ Name: "internal_policy_history", Columns: InternalPolicyHistoryColumns, PrimaryKey: []*schema.Column{InternalPolicyHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "internalpolicyhistory_history_time", Unique: false, Columns: []*schema.Column{InternalPolicyHistoryColumns[1]}, }, }, } // InvitesColumns holds the columns for the "invites" table. InvitesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "token", Type: field.TypeString, Unique: true}, {Name: "expires", Type: field.TypeTime, Nullable: true}, {Name: "recipient", Type: field.TypeString}, {Name: "status", Type: field.TypeEnum, Enums: []string{"INVITATION_SENT", "APPROVAL_REQUIRED", "INVITATION_ACCEPTED", "INVITATION_EXPIRED"}, Default: "INVITATION_SENT"}, {Name: "role", Type: field.TypeEnum, Enums: []string{"ADMIN", "MEMBER"}, Default: "MEMBER"}, {Name: "send_attempts", Type: field.TypeInt, Default: 0}, {Name: "requestor_id", Type: field.TypeString, Nullable: true}, {Name: "secret", Type: field.TypeBytes}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, } // InvitesTable holds the schema information for the "invites" table. InvitesTable = &schema.Table{ Name: "invites", Columns: InvitesColumns, PrimaryKey: []*schema.Column{InvitesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "invites_organizations_invites", Columns: []*schema.Column{InvitesColumns[16]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "invite_recipient_owner_id", Unique: true, Columns: []*schema.Column{InvitesColumns[10], InvitesColumns[16]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at is NULL", }, }, }, } // NarrativesColumns holds the columns for the "narratives" table. NarrativesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "satisfies", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "details", Type: field.TypeJSON, Nullable: true}, {Name: "owner_id", Type: field.TypeString}, } // NarrativesTable holds the schema information for the "narratives" table. NarrativesTable = &schema.Table{ Name: "narratives", Columns: NarrativesColumns, PrimaryKey: []*schema.Column{NarrativesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "narratives_organizations_narratives", Columns: []*schema.Column{NarrativesColumns[13]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, }, } // NarrativeHistoryColumns holds the columns for the "narrative_history" table. NarrativeHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "owner_id", Type: field.TypeString}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "satisfies", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "details", Type: field.TypeJSON, Nullable: true}, } // NarrativeHistoryTable holds the schema information for the "narrative_history" table. NarrativeHistoryTable = &schema.Table{ Name: "narrative_history", Columns: NarrativeHistoryColumns, PrimaryKey: []*schema.Column{NarrativeHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "narrativehistory_history_time", Unique: false, Columns: []*schema.Column{NarrativeHistoryColumns[1]}, }, }, } // NotesColumns holds the columns for the "notes" table. NotesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "text", Type: field.TypeString}, {Name: "entity_notes", Type: field.TypeString, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, } // NotesTable holds the schema information for the "notes" table. NotesTable = &schema.Table{ Name: "notes", Columns: NotesColumns, PrimaryKey: []*schema.Column{NotesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "notes_entities_notes", Columns: []*schema.Column{NotesColumns[10]}, RefColumns: []*schema.Column{EntitiesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "notes_organizations_notes", Columns: []*schema.Column{NotesColumns[11]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.SetNull, }, }, } // NoteHistoryColumns holds the columns for the "note_history" table. NoteHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, {Name: "text", Type: field.TypeString}, } // NoteHistoryTable holds the schema information for the "note_history" table. NoteHistoryTable = &schema.Table{ Name: "note_history", Columns: NoteHistoryColumns, PrimaryKey: []*schema.Column{NoteHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "notehistory_history_time", Unique: false, Columns: []*schema.Column{NoteHistoryColumns[1]}, }, }, } // OrgMembershipsColumns holds the columns for the "org_memberships" table. OrgMembershipsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "role", Type: field.TypeEnum, Enums: []string{"ADMIN", "MEMBER", "OWNER"}, Default: "MEMBER"}, {Name: "organization_id", Type: field.TypeString}, {Name: "user_id", Type: field.TypeString}, } // OrgMembershipsTable holds the schema information for the "org_memberships" table. OrgMembershipsTable = &schema.Table{ Name: "org_memberships", Columns: OrgMembershipsColumns, PrimaryKey: []*schema.Column{OrgMembershipsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "org_memberships_organizations_organization", Columns: []*schema.Column{OrgMembershipsColumns[9]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "org_memberships_users_user", Columns: []*schema.Column{OrgMembershipsColumns[10]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "orgmembership_user_id_organization_id", Unique: true, Columns: []*schema.Column{OrgMembershipsColumns[10], OrgMembershipsColumns[9]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at is NULL", }, }, }, } // OrgMembershipHistoryColumns holds the columns for the "org_membership_history" table. OrgMembershipHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "role", Type: field.TypeEnum, Enums: []string{"ADMIN", "MEMBER", "OWNER"}, Default: "MEMBER"}, {Name: "organization_id", Type: field.TypeString}, {Name: "user_id", Type: field.TypeString}, } // OrgMembershipHistoryTable holds the schema information for the "org_membership_history" table. OrgMembershipHistoryTable = &schema.Table{ Name: "org_membership_history", Columns: OrgMembershipHistoryColumns, PrimaryKey: []*schema.Column{OrgMembershipHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "orgmembershiphistory_history_time", Unique: false, Columns: []*schema.Column{OrgMembershipHistoryColumns[1]}, }, }, } // OrgSubscriptionsColumns holds the columns for the "org_subscriptions" table. OrgSubscriptionsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "stripe_subscription_id", Type: field.TypeString, Nullable: true}, {Name: "product_tier", Type: field.TypeString, Nullable: true}, {Name: "stripe_product_tier_id", Type: field.TypeString, Nullable: true}, {Name: "stripe_subscription_status", Type: field.TypeString, Nullable: true}, {Name: "active", Type: field.TypeBool, Default: true}, {Name: "stripe_customer_id", Type: field.TypeString, Unique: true, Nullable: true}, {Name: "expires_at", Type: field.TypeTime, Nullable: true}, {Name: "features", Type: field.TypeJSON, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, } // OrgSubscriptionsTable holds the schema information for the "org_subscriptions" table. OrgSubscriptionsTable = &schema.Table{ Name: "org_subscriptions", Columns: OrgSubscriptionsColumns, PrimaryKey: []*schema.Column{OrgSubscriptionsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "org_subscriptions_organizations_org_subscriptions", Columns: []*schema.Column{OrgSubscriptionsColumns[17]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.SetNull, }, }, } // OrgSubscriptionHistoryColumns holds the columns for the "org_subscription_history" table. OrgSubscriptionHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, {Name: "stripe_subscription_id", Type: field.TypeString, Nullable: true}, {Name: "product_tier", Type: field.TypeString, Nullable: true}, {Name: "stripe_product_tier_id", Type: field.TypeString, Nullable: true}, {Name: "stripe_subscription_status", Type: field.TypeString, Nullable: true}, {Name: "active", Type: field.TypeBool, Default: true}, {Name: "stripe_customer_id", Type: field.TypeString, Nullable: true}, {Name: "expires_at", Type: field.TypeTime, Nullable: true}, {Name: "features", Type: field.TypeJSON, Nullable: true}, } // OrgSubscriptionHistoryTable holds the schema information for the "org_subscription_history" table. OrgSubscriptionHistoryTable = &schema.Table{ Name: "org_subscription_history", Columns: OrgSubscriptionHistoryColumns, PrimaryKey: []*schema.Column{OrgSubscriptionHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "orgsubscriptionhistory_history_time", Unique: false, Columns: []*schema.Column{OrgSubscriptionHistoryColumns[1]}, }, }, } // OrganizationsColumns holds the columns for the "organizations" table. OrganizationsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "name", Type: field.TypeString, Size: 160}, {Name: "display_name", Type: field.TypeString, Size: 64, Default: ""}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "personal_org", Type: field.TypeBool, Nullable: true, Default: false}, {Name: "avatar_remote_url", Type: field.TypeString, Nullable: true, Size: 2048}, {Name: "dedicated_db", Type: field.TypeBool, Default: false}, {Name: "parent_organization_id", Type: field.TypeString, Nullable: true}, } // OrganizationsTable holds the schema information for the "organizations" table. OrganizationsTable = &schema.Table{ Name: "organizations", Columns: OrganizationsColumns, PrimaryKey: []*schema.Column{OrganizationsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organizations_organizations_children", Columns: []*schema.Column{OrganizationsColumns[15]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "organization_name", Unique: true, Columns: []*schema.Column{OrganizationsColumns[9]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at is NULL", }, }, }, } // OrganizationHistoryColumns holds the columns for the "organization_history" table. OrganizationHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "name", Type: field.TypeString, Size: 160}, {Name: "display_name", Type: field.TypeString, Size: 64, Default: ""}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "parent_organization_id", Type: field.TypeString, Nullable: true}, {Name: "personal_org", Type: field.TypeBool, Nullable: true, Default: false}, {Name: "avatar_remote_url", Type: field.TypeString, Nullable: true, Size: 2048}, {Name: "dedicated_db", Type: field.TypeBool, Default: false}, } // OrganizationHistoryTable holds the schema information for the "organization_history" table. OrganizationHistoryTable = &schema.Table{ Name: "organization_history", Columns: OrganizationHistoryColumns, PrimaryKey: []*schema.Column{OrganizationHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "organizationhistory_history_time", Unique: false, Columns: []*schema.Column{OrganizationHistoryColumns[1]}, }, }, } // OrganizationSettingsColumns holds the columns for the "organization_settings" table. OrganizationSettingsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "domains", Type: field.TypeJSON, Nullable: true}, {Name: "billing_contact", Type: field.TypeString, Nullable: true}, {Name: "billing_email", Type: field.TypeString, Nullable: true}, {Name: "billing_phone", Type: field.TypeString, Nullable: true}, {Name: "billing_address", Type: field.TypeString, Nullable: true}, {Name: "tax_identifier", Type: field.TypeString, Nullable: true}, {Name: "geo_location", Type: field.TypeEnum, Nullable: true, Enums: []string{"AMER", "EMEA", "APAC"}, Default: "AMER"}, {Name: "stripe_id", Type: field.TypeString, Nullable: true}, {Name: "organization_id", Type: field.TypeString, Unique: true, Nullable: true}, } // OrganizationSettingsTable holds the schema information for the "organization_settings" table. OrganizationSettingsTable = &schema.Table{ Name: "organization_settings", Columns: OrganizationSettingsColumns, PrimaryKey: []*schema.Column{OrganizationSettingsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organization_settings_organizations_setting", Columns: []*schema.Column{OrganizationSettingsColumns[17]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.SetNull, }, }, } // OrganizationSettingHistoryColumns holds the columns for the "organization_setting_history" table. OrganizationSettingHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "domains", Type: field.TypeJSON, Nullable: true}, {Name: "billing_contact", Type: field.TypeString, Nullable: true}, {Name: "billing_email", Type: field.TypeString, Nullable: true}, {Name: "billing_phone", Type: field.TypeString, Nullable: true}, {Name: "billing_address", Type: field.TypeString, Nullable: true}, {Name: "tax_identifier", Type: field.TypeString, Nullable: true}, {Name: "geo_location", Type: field.TypeEnum, Nullable: true, Enums: []string{"AMER", "EMEA", "APAC"}, Default: "AMER"}, {Name: "organization_id", Type: field.TypeString, Nullable: true}, {Name: "stripe_id", Type: field.TypeString, Nullable: true}, } // OrganizationSettingHistoryTable holds the schema information for the "organization_setting_history" table. OrganizationSettingHistoryTable = &schema.Table{ Name: "organization_setting_history", Columns: OrganizationSettingHistoryColumns, PrimaryKey: []*schema.Column{OrganizationSettingHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "organizationsettinghistory_history_time", Unique: false, Columns: []*schema.Column{OrganizationSettingHistoryColumns[1]}, }, }, } // PasswordResetTokensColumns holds the columns for the "password_reset_tokens" table. PasswordResetTokensColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "token", Type: field.TypeString, Unique: true}, {Name: "ttl", Type: field.TypeTime}, {Name: "email", Type: field.TypeString}, {Name: "secret", Type: field.TypeBytes}, {Name: "owner_id", Type: field.TypeString}, } // PasswordResetTokensTable holds the schema information for the "password_reset_tokens" table. PasswordResetTokensTable = &schema.Table{ Name: "password_reset_tokens", Columns: PasswordResetTokensColumns, PrimaryKey: []*schema.Column{PasswordResetTokensColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "password_reset_tokens_users_password_reset_tokens", Columns: []*schema.Column{PasswordResetTokensColumns[12]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "passwordresettoken_token", Unique: true, Columns: []*schema.Column{PasswordResetTokensColumns[8]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at is NULL", }, }, }, } // PersonalAccessTokensColumns holds the columns for the "personal_access_tokens" table. PersonalAccessTokensColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "token", Type: field.TypeString, Unique: true}, {Name: "expires_at", Type: field.TypeTime, Nullable: true}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "scopes", Type: field.TypeJSON, Nullable: true}, {Name: "last_used_at", Type: field.TypeTime, Nullable: true}, {Name: "owner_id", Type: field.TypeString}, } // PersonalAccessTokensTable holds the schema information for the "personal_access_tokens" table. PersonalAccessTokensTable = &schema.Table{ Name: "personal_access_tokens", Columns: PersonalAccessTokensColumns, PrimaryKey: []*schema.Column{PersonalAccessTokensColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "personal_access_tokens_users_personal_access_tokens", Columns: []*schema.Column{PersonalAccessTokensColumns[15]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "personalaccesstoken_token", Unique: false, Columns: []*schema.Column{PersonalAccessTokensColumns[10]}, }, }, } // ProceduresColumns holds the columns for the "procedures" table. ProceduresColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "status", Type: field.TypeString, Nullable: true}, {Name: "procedure_type", Type: field.TypeString, Nullable: true}, {Name: "version", Type: field.TypeString, Nullable: true}, {Name: "purpose_and_scope", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "background", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "satisfies", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "details", Type: field.TypeJSON, Nullable: true}, {Name: "control_objective_procedures", Type: field.TypeString, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, {Name: "standard_procedures", Type: field.TypeString, Nullable: true}, } // ProceduresTable holds the schema information for the "procedures" table. ProceduresTable = &schema.Table{ Name: "procedures", Columns: ProceduresColumns, PrimaryKey: []*schema.Column{ProceduresColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "procedures_control_objectives_procedures", Columns: []*schema.Column{ProceduresColumns[18]}, RefColumns: []*schema.Column{ControlObjectivesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "procedures_organizations_procedures", Columns: []*schema.Column{ProceduresColumns[19]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "procedures_standards_procedures", Columns: []*schema.Column{ProceduresColumns[20]}, RefColumns: []*schema.Column{StandardsColumns[0]}, OnDelete: schema.SetNull, }, }, } // ProcedureHistoryColumns holds the columns for the "procedure_history" table. ProcedureHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "status", Type: field.TypeString, Nullable: true}, {Name: "procedure_type", Type: field.TypeString, Nullable: true}, {Name: "version", Type: field.TypeString, Nullable: true}, {Name: "purpose_and_scope", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "background", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "satisfies", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "details", Type: field.TypeJSON, Nullable: true}, } // ProcedureHistoryTable holds the schema information for the "procedure_history" table. ProcedureHistoryTable = &schema.Table{ Name: "procedure_history", Columns: ProcedureHistoryColumns, PrimaryKey: []*schema.Column{ProcedureHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "procedurehistory_history_time", Unique: false, Columns: []*schema.Column{ProcedureHistoryColumns[1]}, }, }, } // ProgramsColumns holds the columns for the "programs" table. ProgramsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "status", Type: field.TypeEnum, Enums: []string{"NOT_STARTED", "IN_PROGRESS", "READY_FOR_AUDITOR", "COMPLETED", "ACTION_REQUIRED"}, Default: "NOT_STARTED"}, {Name: "start_date", Type: field.TypeTime, Nullable: true}, {Name: "end_date", Type: field.TypeTime, Nullable: true}, {Name: "auditor_ready", Type: field.TypeBool, Default: false}, {Name: "auditor_write_comments", Type: field.TypeBool, Default: false}, {Name: "auditor_read_comments", Type: field.TypeBool, Default: false}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, } // ProgramsTable holds the schema information for the "programs" table. ProgramsTable = &schema.Table{ Name: "programs", Columns: ProgramsColumns, PrimaryKey: []*schema.Column{ProgramsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "programs_organizations_programs", Columns: []*schema.Column{ProgramsColumns[17]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.SetNull, }, }, } // ProgramHistoryColumns holds the columns for the "program_history" table. ProgramHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "status", Type: field.TypeEnum, Enums: []string{"NOT_STARTED", "IN_PROGRESS", "READY_FOR_AUDITOR", "COMPLETED", "ACTION_REQUIRED"}, Default: "NOT_STARTED"}, {Name: "start_date", Type: field.TypeTime, Nullable: true}, {Name: "end_date", Type: field.TypeTime, Nullable: true}, {Name: "auditor_ready", Type: field.TypeBool, Default: false}, {Name: "auditor_write_comments", Type: field.TypeBool, Default: false}, {Name: "auditor_read_comments", Type: field.TypeBool, Default: false}, } // ProgramHistoryTable holds the schema information for the "program_history" table. ProgramHistoryTable = &schema.Table{ Name: "program_history", Columns: ProgramHistoryColumns, PrimaryKey: []*schema.Column{ProgramHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "programhistory_history_time", Unique: false, Columns: []*schema.Column{ProgramHistoryColumns[1]}, }, }, } // ProgramMembershipsColumns holds the columns for the "program_memberships" table. ProgramMembershipsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "role", Type: field.TypeEnum, Enums: []string{"ADMIN", "MEMBER"}, Default: "MEMBER"}, {Name: "program_id", Type: field.TypeString}, {Name: "user_id", Type: field.TypeString}, } // ProgramMembershipsTable holds the schema information for the "program_memberships" table. ProgramMembershipsTable = &schema.Table{ Name: "program_memberships", Columns: ProgramMembershipsColumns, PrimaryKey: []*schema.Column{ProgramMembershipsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "program_memberships_programs_program", Columns: []*schema.Column{ProgramMembershipsColumns[9]}, RefColumns: []*schema.Column{ProgramsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "program_memberships_users_user", Columns: []*schema.Column{ProgramMembershipsColumns[10]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "programmembership_user_id_program_id", Unique: true, Columns: []*schema.Column{ProgramMembershipsColumns[10], ProgramMembershipsColumns[9]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at is NULL", }, }, }, } // ProgramMembershipHistoryColumns holds the columns for the "program_membership_history" table. ProgramMembershipHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "role", Type: field.TypeEnum, Enums: []string{"ADMIN", "MEMBER"}, Default: "MEMBER"}, {Name: "program_id", Type: field.TypeString}, {Name: "user_id", Type: field.TypeString}, } // ProgramMembershipHistoryTable holds the schema information for the "program_membership_history" table. ProgramMembershipHistoryTable = &schema.Table{ Name: "program_membership_history", Columns: ProgramMembershipHistoryColumns, PrimaryKey: []*schema.Column{ProgramMembershipHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "programmembershiphistory_history_time", Unique: false, Columns: []*schema.Column{ProgramMembershipHistoryColumns[1]}, }, }, } // RisksColumns holds the columns for the "risks" table. RisksColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "status", Type: field.TypeString, Nullable: true}, {Name: "risk_type", Type: field.TypeString, Nullable: true}, {Name: "business_costs", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "impact", Type: field.TypeEnum, Nullable: true, Enums: []string{"LOW", "MODERATE", "HIGH"}, Default: "MODERATE"}, {Name: "likelihood", Type: field.TypeEnum, Nullable: true, Enums: []string{"UNLIKELY", "LIKELY", "HIGHLY_LIKELY"}, Default: "LIKELY"}, {Name: "mitigation", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "satisfies", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "details", Type: field.TypeJSON, Nullable: true}, {Name: "control_objective_risks", Type: field.TypeString, Nullable: true}, {Name: "owner_id", Type: field.TypeString}, } // RisksTable holds the schema information for the "risks" table. RisksTable = &schema.Table{ Name: "risks", Columns: RisksColumns, PrimaryKey: []*schema.Column{RisksColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "risks_control_objectives_risks", Columns: []*schema.Column{RisksColumns[19]}, RefColumns: []*schema.Column{ControlObjectivesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "risks_organizations_risks", Columns: []*schema.Column{RisksColumns[20]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, }, } // RiskHistoryColumns holds the columns for the "risk_history" table. RiskHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "owner_id", Type: field.TypeString}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "status", Type: field.TypeString, Nullable: true}, {Name: "risk_type", Type: field.TypeString, Nullable: true}, {Name: "business_costs", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "impact", Type: field.TypeEnum, Nullable: true, Enums: []string{"LOW", "MODERATE", "HIGH"}, Default: "MODERATE"}, {Name: "likelihood", Type: field.TypeEnum, Nullable: true, Enums: []string{"UNLIKELY", "LIKELY", "HIGHLY_LIKELY"}, Default: "LIKELY"}, {Name: "mitigation", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "satisfies", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "details", Type: field.TypeJSON, Nullable: true}, } // RiskHistoryTable holds the schema information for the "risk_history" table. RiskHistoryTable = &schema.Table{ Name: "risk_history", Columns: RiskHistoryColumns, PrimaryKey: []*schema.Column{RiskHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "riskhistory_history_time", Unique: false, Columns: []*schema.Column{RiskHistoryColumns[1]}, }, }, } // StandardsColumns holds the columns for the "standards" table. StandardsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "family", Type: field.TypeString, Nullable: true}, {Name: "status", Type: field.TypeString, Nullable: true}, {Name: "standard_type", Type: field.TypeString, Nullable: true}, {Name: "version", Type: field.TypeString, Nullable: true}, {Name: "purpose_and_scope", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "background", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "satisfies", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "details", Type: field.TypeJSON, Nullable: true}, } // StandardsTable holds the schema information for the "standards" table. StandardsTable = &schema.Table{ Name: "standards", Columns: StandardsColumns, PrimaryKey: []*schema.Column{StandardsColumns[0]}, } // StandardHistoryColumns holds the columns for the "standard_history" table. StandardHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "family", Type: field.TypeString, Nullable: true}, {Name: "status", Type: field.TypeString, Nullable: true}, {Name: "standard_type", Type: field.TypeString, Nullable: true}, {Name: "version", Type: field.TypeString, Nullable: true}, {Name: "purpose_and_scope", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "background", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "satisfies", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "details", Type: field.TypeJSON, Nullable: true}, } // StandardHistoryTable holds the schema information for the "standard_history" table. StandardHistoryTable = &schema.Table{ Name: "standard_history", Columns: StandardHistoryColumns, PrimaryKey: []*schema.Column{StandardHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "standardhistory_history_time", Unique: false, Columns: []*schema.Column{StandardHistoryColumns[1]}, }, }, } // SubcontrolsColumns holds the columns for the "subcontrols" table. SubcontrolsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "status", Type: field.TypeString, Nullable: true}, {Name: "subcontrol_type", Type: field.TypeString, Nullable: true}, {Name: "version", Type: field.TypeString, Nullable: true}, {Name: "subcontrol_number", Type: field.TypeString, Nullable: true}, {Name: "family", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "class", Type: field.TypeString, Nullable: true}, {Name: "source", Type: field.TypeString, Nullable: true}, {Name: "mapped_frameworks", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "implementation_evidence", Type: field.TypeString, Nullable: true}, {Name: "implementation_status", Type: field.TypeString, Nullable: true}, {Name: "implementation_date", Type: field.TypeTime, Nullable: true}, {Name: "implementation_verification", Type: field.TypeString, Nullable: true}, {Name: "implementation_verification_date", Type: field.TypeTime, Nullable: true}, {Name: "details", Type: field.TypeJSON, Nullable: true}, {Name: "control_objective_subcontrols", Type: field.TypeString, Nullable: true}, {Name: "note_subcontrols", Type: field.TypeString, Nullable: true}, {Name: "owner_id", Type: field.TypeString}, } // SubcontrolsTable holds the schema information for the "subcontrols" table. SubcontrolsTable = &schema.Table{ Name: "subcontrols", Columns: SubcontrolsColumns, PrimaryKey: []*schema.Column{SubcontrolsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "subcontrols_control_objectives_subcontrols", Columns: []*schema.Column{SubcontrolsColumns[25]}, RefColumns: []*schema.Column{ControlObjectivesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "subcontrols_notes_subcontrols", Columns: []*schema.Column{SubcontrolsColumns[26]}, RefColumns: []*schema.Column{NotesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "subcontrols_organizations_subcontrols", Columns: []*schema.Column{SubcontrolsColumns[27]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, }, } // SubcontrolHistoryColumns holds the columns for the "subcontrol_history" table. SubcontrolHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "owner_id", Type: field.TypeString}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "status", Type: field.TypeString, Nullable: true}, {Name: "subcontrol_type", Type: field.TypeString, Nullable: true}, {Name: "version", Type: field.TypeString, Nullable: true}, {Name: "subcontrol_number", Type: field.TypeString, Nullable: true}, {Name: "family", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "class", Type: field.TypeString, Nullable: true}, {Name: "source", Type: field.TypeString, Nullable: true}, {Name: "mapped_frameworks", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "implementation_evidence", Type: field.TypeString, Nullable: true}, {Name: "implementation_status", Type: field.TypeString, Nullable: true}, {Name: "implementation_date", Type: field.TypeTime, Nullable: true}, {Name: "implementation_verification", Type: field.TypeString, Nullable: true}, {Name: "implementation_verification_date", Type: field.TypeTime, Nullable: true}, {Name: "details", Type: field.TypeJSON, Nullable: true}, } // SubcontrolHistoryTable holds the schema information for the "subcontrol_history" table. SubcontrolHistoryTable = &schema.Table{ Name: "subcontrol_history", Columns: SubcontrolHistoryColumns, PrimaryKey: []*schema.Column{SubcontrolHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "subcontrolhistory_history_time", Unique: false, Columns: []*schema.Column{SubcontrolHistoryColumns[1]}, }, }, } // SubscribersColumns holds the columns for the "subscribers" table. SubscribersColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "email", Type: field.TypeString}, {Name: "phone_number", Type: field.TypeString, Nullable: true}, {Name: "verified_email", Type: field.TypeBool, Default: false}, {Name: "verified_phone", Type: field.TypeBool, Default: false}, {Name: "active", Type: field.TypeBool, Default: false}, {Name: "token", Type: field.TypeString, Unique: true}, {Name: "ttl", Type: field.TypeTime}, {Name: "secret", Type: field.TypeBytes}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, } // SubscribersTable holds the schema information for the "subscribers" table. SubscribersTable = &schema.Table{ Name: "subscribers", Columns: SubscribersColumns, PrimaryKey: []*schema.Column{SubscribersColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "subscribers_organizations_subscribers", Columns: []*schema.Column{SubscribersColumns[17]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "subscriber_email_owner_id", Unique: true, Columns: []*schema.Column{SubscribersColumns[9], SubscribersColumns[17]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at is NULL", }, }, }, } // TfaSettingsColumns holds the columns for the "tfa_settings" table. TfaSettingsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "tfa_secret", Type: field.TypeString, Nullable: true}, {Name: "verified", Type: field.TypeBool, Default: false}, {Name: "recovery_codes", Type: field.TypeJSON, Nullable: true}, {Name: "phone_otp_allowed", Type: field.TypeBool, Nullable: true, Default: false}, {Name: "email_otp_allowed", Type: field.TypeBool, Nullable: true, Default: false}, {Name: "totp_allowed", Type: field.TypeBool, Nullable: true, Default: false}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, } // TfaSettingsTable holds the schema information for the "tfa_settings" table. TfaSettingsTable = &schema.Table{ Name: "tfa_settings", Columns: TfaSettingsColumns, PrimaryKey: []*schema.Column{TfaSettingsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "tfa_settings_users_tfa_settings", Columns: []*schema.Column{TfaSettingsColumns[15]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "tfasetting_owner_id", Unique: true, Columns: []*schema.Column{TfaSettingsColumns[15]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at is NULL", }, }, }, } // TasksColumns holds the columns for the "tasks" table. TasksColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "title", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "details", Type: field.TypeJSON, Nullable: true}, {Name: "status", Type: field.TypeEnum, Enums: []string{"OPEN", "IN_PROGRESS", "IN_REVIEW", "COMPLETED", "WONT_DO"}, Default: "OPEN"}, {Name: "due", Type: field.TypeTime, Nullable: true}, {Name: "completed", Type: field.TypeTime, Nullable: true}, {Name: "user_assigner_tasks", Type: field.TypeString}, {Name: "user_assignee_tasks", Type: field.TypeString, Nullable: true}, } // TasksTable holds the schema information for the "tasks" table. TasksTable = &schema.Table{ Name: "tasks", Columns: TasksColumns, PrimaryKey: []*schema.Column{TasksColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "tasks_users_assigner_tasks", Columns: []*schema.Column{TasksColumns[15]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "tasks_users_assignee_tasks", Columns: []*schema.Column{TasksColumns[16]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.SetNull, }, }, } // TaskHistoryColumns holds the columns for the "task_history" table. TaskHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "title", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "details", Type: field.TypeJSON, Nullable: true}, {Name: "status", Type: field.TypeEnum, Enums: []string{"OPEN", "IN_PROGRESS", "IN_REVIEW", "COMPLETED", "WONT_DO"}, Default: "OPEN"}, {Name: "due", Type: field.TypeTime, Nullable: true}, {Name: "completed", Type: field.TypeTime, Nullable: true}, } // TaskHistoryTable holds the schema information for the "task_history" table. TaskHistoryTable = &schema.Table{ Name: "task_history", Columns: TaskHistoryColumns, PrimaryKey: []*schema.Column{TaskHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "taskhistory_history_time", Unique: false, Columns: []*schema.Column{TaskHistoryColumns[1]}, }, }, } // TemplatesColumns holds the columns for the "templates" table. TemplatesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "template_type", Type: field.TypeEnum, Enums: []string{"ROOTTEMPLATE", "DOCUMENT"}, Default: "DOCUMENT"}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "jsonconfig", Type: field.TypeJSON}, {Name: "uischema", Type: field.TypeJSON, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, } // TemplatesTable holds the schema information for the "templates" table. TemplatesTable = &schema.Table{ Name: "templates", Columns: TemplatesColumns, PrimaryKey: []*schema.Column{TemplatesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "templates_organizations_templates", Columns: []*schema.Column{TemplatesColumns[14]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "template_name_owner_id_template_type", Unique: true, Columns: []*schema.Column{TemplatesColumns[9], TemplatesColumns[14], TemplatesColumns[10]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at is NULL", }, }, }, } // TemplateHistoryColumns holds the columns for the "template_history" table. TemplateHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "owner_id", Type: field.TypeString, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "template_type", Type: field.TypeEnum, Enums: []string{"ROOTTEMPLATE", "DOCUMENT"}, Default: "DOCUMENT"}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "jsonconfig", Type: field.TypeJSON}, {Name: "uischema", Type: field.TypeJSON, Nullable: true}, } // TemplateHistoryTable holds the schema information for the "template_history" table. TemplateHistoryTable = &schema.Table{ Name: "template_history", Columns: TemplateHistoryColumns, PrimaryKey: []*schema.Column{TemplateHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "templatehistory_history_time", Unique: false, Columns: []*schema.Column{TemplateHistoryColumns[1]}, }, }, } // UsersColumns holds the columns for the "users" table. UsersColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "email", Type: field.TypeString}, {Name: "first_name", Type: field.TypeString, Nullable: true, Size: 64}, {Name: "last_name", Type: field.TypeString, Nullable: true, Size: 64}, {Name: "display_name", Type: field.TypeString, Size: 64}, {Name: "avatar_remote_url", Type: field.TypeString, Nullable: true, Size: 2048}, {Name: "avatar_local_file", Type: field.TypeString, Nullable: true, Size: 2048}, {Name: "avatar_updated_at", Type: field.TypeTime, Nullable: true}, {Name: "last_seen", Type: field.TypeTime, Nullable: true}, {Name: "password", Type: field.TypeString, Nullable: true}, {Name: "sub", Type: field.TypeString, Unique: true, Nullable: true}, {Name: "auth_provider", Type: field.TypeEnum, Enums: []string{"CREDENTIALS", "GOOGLE", "GITHUB", "WEBAUTHN"}, Default: "CREDENTIALS"}, {Name: "role", Type: field.TypeEnum, Nullable: true, Enums: []string{"ADMIN", "MEMBER", "USER"}, Default: "USER"}, {Name: "avatar_local_file_id", Type: field.TypeString, Nullable: true}, } // UsersTable holds the schema information for the "users" table. UsersTable = &schema.Table{ Name: "users", Columns: UsersColumns, PrimaryKey: []*schema.Column{UsersColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "users_files_file", Columns: []*schema.Column{UsersColumns[21]}, RefColumns: []*schema.Column{FilesColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "user_id", Unique: true, Columns: []*schema.Column{UsersColumns[0]}, }, { Name: "user_email_auth_provider", Unique: true, Columns: []*schema.Column{UsersColumns[9], UsersColumns[19]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at is NULL", }, }, }, } // UserHistoryColumns holds the columns for the "user_history" table. UserHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "email", Type: field.TypeString}, {Name: "first_name", Type: field.TypeString, Nullable: true, Size: 64}, {Name: "last_name", Type: field.TypeString, Nullable: true, Size: 64}, {Name: "display_name", Type: field.TypeString, Size: 64}, {Name: "avatar_remote_url", Type: field.TypeString, Nullable: true, Size: 2048}, {Name: "avatar_local_file", Type: field.TypeString, Nullable: true, Size: 2048}, {Name: "avatar_local_file_id", Type: field.TypeString, Nullable: true}, {Name: "avatar_updated_at", Type: field.TypeTime, Nullable: true}, {Name: "last_seen", Type: field.TypeTime, Nullable: true}, {Name: "password", Type: field.TypeString, Nullable: true}, {Name: "sub", Type: field.TypeString, Nullable: true}, {Name: "auth_provider", Type: field.TypeEnum, Enums: []string{"CREDENTIALS", "GOOGLE", "GITHUB", "WEBAUTHN"}, Default: "CREDENTIALS"}, {Name: "role", Type: field.TypeEnum, Nullable: true, Enums: []string{"ADMIN", "MEMBER", "USER"}, Default: "USER"}, } // UserHistoryTable holds the schema information for the "user_history" table. UserHistoryTable = &schema.Table{ Name: "user_history", Columns: UserHistoryColumns, PrimaryKey: []*schema.Column{UserHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "userhistory_history_time", Unique: false, Columns: []*schema.Column{UserHistoryColumns[1]}, }, }, } // UserSettingsColumns holds the columns for the "user_settings" table. UserSettingsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "locked", Type: field.TypeBool, Default: false}, {Name: "silenced_at", Type: field.TypeTime, Nullable: true}, {Name: "suspended_at", Type: field.TypeTime, Nullable: true}, {Name: "status", Type: field.TypeEnum, Enums: []string{"ACTIVE", "INACTIVE", "DEACTIVATED", "SUSPENDED", "ONBOARDING"}, Default: "ACTIVE"}, {Name: "email_confirmed", Type: field.TypeBool, Default: false}, {Name: "is_webauthn_allowed", Type: field.TypeBool, Nullable: true, Default: false}, {Name: "is_tfa_enabled", Type: field.TypeBool, Nullable: true, Default: false}, {Name: "phone_number", Type: field.TypeString, Nullable: true}, {Name: "user_id", Type: field.TypeString, Unique: true, Nullable: true}, {Name: "user_setting_default_org", Type: field.TypeString, Nullable: true}, } // UserSettingsTable holds the schema information for the "user_settings" table. UserSettingsTable = &schema.Table{ Name: "user_settings", Columns: UserSettingsColumns, PrimaryKey: []*schema.Column{UserSettingsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "user_settings_users_setting", Columns: []*schema.Column{UserSettingsColumns[17]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "user_settings_organizations_default_org", Columns: []*schema.Column{UserSettingsColumns[18]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.SetNull, }, }, } // UserSettingHistoryColumns holds the columns for the "user_setting_history" table. UserSettingHistoryColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "history_time", Type: field.TypeTime}, {Name: "ref", Type: field.TypeString, Nullable: true}, {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "user_id", Type: field.TypeString, Nullable: true}, {Name: "locked", Type: field.TypeBool, Default: false}, {Name: "silenced_at", Type: field.TypeTime, Nullable: true}, {Name: "suspended_at", Type: field.TypeTime, Nullable: true}, {Name: "status", Type: field.TypeEnum, Enums: []string{"ACTIVE", "INACTIVE", "DEACTIVATED", "SUSPENDED", "ONBOARDING"}, Default: "ACTIVE"}, {Name: "email_confirmed", Type: field.TypeBool, Default: false}, {Name: "is_webauthn_allowed", Type: field.TypeBool, Nullable: true, Default: false}, {Name: "is_tfa_enabled", Type: field.TypeBool, Nullable: true, Default: false}, {Name: "phone_number", Type: field.TypeString, Nullable: true}, } // UserSettingHistoryTable holds the schema information for the "user_setting_history" table. UserSettingHistoryTable = &schema.Table{ Name: "user_setting_history", Columns: UserSettingHistoryColumns, PrimaryKey: []*schema.Column{UserSettingHistoryColumns[0]}, Indexes: []*schema.Index{ { Name: "usersettinghistory_history_time", Unique: false, Columns: []*schema.Column{UserSettingHistoryColumns[1]}, }, }, } // WebauthnsColumns holds the columns for the "webauthns" table. WebauthnsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "created_by", Type: field.TypeString, Nullable: true}, {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "mapping_id", Type: field.TypeString, Unique: true}, {Name: "tags", Type: field.TypeJSON, Nullable: true}, {Name: "credential_id", Type: field.TypeBytes, Unique: true, Nullable: true}, {Name: "public_key", Type: field.TypeBytes, Nullable: true}, {Name: "attestation_type", Type: field.TypeString, Nullable: true}, {Name: "aaguid", Type: field.TypeBytes, Unique: true}, {Name: "sign_count", Type: field.TypeInt32}, {Name: "transports", Type: field.TypeJSON}, {Name: "backup_eligible", Type: field.TypeBool, Default: false}, {Name: "backup_state", Type: field.TypeBool, Default: false}, {Name: "user_present", Type: field.TypeBool, Default: false}, {Name: "user_verified", Type: field.TypeBool, Default: false}, {Name: "owner_id", Type: field.TypeString}, } // WebauthnsTable holds the schema information for the "webauthns" table. WebauthnsTable = &schema.Table{ Name: "webauthns", Columns: WebauthnsColumns, PrimaryKey: []*schema.Column{WebauthnsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "webauthns_users_webauthn", Columns: []*schema.Column{WebauthnsColumns[17]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.NoAction, }, }, } // ContactFilesColumns holds the columns for the "contact_files" table. ContactFilesColumns = []*schema.Column{ {Name: "contact_id", Type: field.TypeString}, {Name: "file_id", Type: field.TypeString}, } // ContactFilesTable holds the schema information for the "contact_files" table. ContactFilesTable = &schema.Table{ Name: "contact_files", Columns: ContactFilesColumns, PrimaryKey: []*schema.Column{ContactFilesColumns[0], ContactFilesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "contact_files_contact_id", Columns: []*schema.Column{ContactFilesColumns[0]}, RefColumns: []*schema.Column{ContactsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "contact_files_file_id", Columns: []*schema.Column{ContactFilesColumns[1]}, RefColumns: []*schema.Column{FilesColumns[0]}, OnDelete: schema.Cascade, }, }, } // ControlBlockedGroupsColumns holds the columns for the "control_blocked_groups" table. ControlBlockedGroupsColumns = []*schema.Column{ {Name: "control_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // ControlBlockedGroupsTable holds the schema information for the "control_blocked_groups" table. ControlBlockedGroupsTable = &schema.Table{ Name: "control_blocked_groups", Columns: ControlBlockedGroupsColumns, PrimaryKey: []*schema.Column{ControlBlockedGroupsColumns[0], ControlBlockedGroupsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "control_blocked_groups_control_id", Columns: []*schema.Column{ControlBlockedGroupsColumns[0]}, RefColumns: []*schema.Column{ControlsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "control_blocked_groups_group_id", Columns: []*schema.Column{ControlBlockedGroupsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // ControlEditorsColumns holds the columns for the "control_editors" table. ControlEditorsColumns = []*schema.Column{ {Name: "control_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // ControlEditorsTable holds the schema information for the "control_editors" table. ControlEditorsTable = &schema.Table{ Name: "control_editors", Columns: ControlEditorsColumns, PrimaryKey: []*schema.Column{ControlEditorsColumns[0], ControlEditorsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "control_editors_control_id", Columns: []*schema.Column{ControlEditorsColumns[0]}, RefColumns: []*schema.Column{ControlsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "control_editors_group_id", Columns: []*schema.Column{ControlEditorsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // ControlViewersColumns holds the columns for the "control_viewers" table. ControlViewersColumns = []*schema.Column{ {Name: "control_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // ControlViewersTable holds the schema information for the "control_viewers" table. ControlViewersTable = &schema.Table{ Name: "control_viewers", Columns: ControlViewersColumns, PrimaryKey: []*schema.Column{ControlViewersColumns[0], ControlViewersColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "control_viewers_control_id", Columns: []*schema.Column{ControlViewersColumns[0]}, RefColumns: []*schema.Column{ControlsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "control_viewers_group_id", Columns: []*schema.Column{ControlViewersColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // ControlProceduresColumns holds the columns for the "control_procedures" table. ControlProceduresColumns = []*schema.Column{ {Name: "control_id", Type: field.TypeString}, {Name: "procedure_id", Type: field.TypeString}, } // ControlProceduresTable holds the schema information for the "control_procedures" table. ControlProceduresTable = &schema.Table{ Name: "control_procedures", Columns: ControlProceduresColumns, PrimaryKey: []*schema.Column{ControlProceduresColumns[0], ControlProceduresColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "control_procedures_control_id", Columns: []*schema.Column{ControlProceduresColumns[0]}, RefColumns: []*schema.Column{ControlsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "control_procedures_procedure_id", Columns: []*schema.Column{ControlProceduresColumns[1]}, RefColumns: []*schema.Column{ProceduresColumns[0]}, OnDelete: schema.Cascade, }, }, } // ControlSubcontrolsColumns holds the columns for the "control_subcontrols" table. ControlSubcontrolsColumns = []*schema.Column{ {Name: "control_id", Type: field.TypeString}, {Name: "subcontrol_id", Type: field.TypeString}, } // ControlSubcontrolsTable holds the schema information for the "control_subcontrols" table. ControlSubcontrolsTable = &schema.Table{ Name: "control_subcontrols", Columns: ControlSubcontrolsColumns, PrimaryKey: []*schema.Column{ControlSubcontrolsColumns[0], ControlSubcontrolsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "control_subcontrols_control_id", Columns: []*schema.Column{ControlSubcontrolsColumns[0]}, RefColumns: []*schema.Column{ControlsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "control_subcontrols_subcontrol_id", Columns: []*schema.Column{ControlSubcontrolsColumns[1]}, RefColumns: []*schema.Column{SubcontrolsColumns[0]}, OnDelete: schema.Cascade, }, }, } // ControlNarrativesColumns holds the columns for the "control_narratives" table. ControlNarrativesColumns = []*schema.Column{ {Name: "control_id", Type: field.TypeString}, {Name: "narrative_id", Type: field.TypeString}, } // ControlNarrativesTable holds the schema information for the "control_narratives" table. ControlNarrativesTable = &schema.Table{ Name: "control_narratives", Columns: ControlNarrativesColumns, PrimaryKey: []*schema.Column{ControlNarrativesColumns[0], ControlNarrativesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "control_narratives_control_id", Columns: []*schema.Column{ControlNarrativesColumns[0]}, RefColumns: []*schema.Column{ControlsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "control_narratives_narrative_id", Columns: []*schema.Column{ControlNarrativesColumns[1]}, RefColumns: []*schema.Column{NarrativesColumns[0]}, OnDelete: schema.Cascade, }, }, } // ControlRisksColumns holds the columns for the "control_risks" table. ControlRisksColumns = []*schema.Column{ {Name: "control_id", Type: field.TypeString}, {Name: "risk_id", Type: field.TypeString}, } // ControlRisksTable holds the schema information for the "control_risks" table. ControlRisksTable = &schema.Table{ Name: "control_risks", Columns: ControlRisksColumns, PrimaryKey: []*schema.Column{ControlRisksColumns[0], ControlRisksColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "control_risks_control_id", Columns: []*schema.Column{ControlRisksColumns[0]}, RefColumns: []*schema.Column{ControlsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "control_risks_risk_id", Columns: []*schema.Column{ControlRisksColumns[1]}, RefColumns: []*schema.Column{RisksColumns[0]}, OnDelete: schema.Cascade, }, }, } // ControlActionPlansColumns holds the columns for the "control_action_plans" table. ControlActionPlansColumns = []*schema.Column{ {Name: "control_id", Type: field.TypeString}, {Name: "action_plan_id", Type: field.TypeString}, } // ControlActionPlansTable holds the schema information for the "control_action_plans" table. ControlActionPlansTable = &schema.Table{ Name: "control_action_plans", Columns: ControlActionPlansColumns, PrimaryKey: []*schema.Column{ControlActionPlansColumns[0], ControlActionPlansColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "control_action_plans_control_id", Columns: []*schema.Column{ControlActionPlansColumns[0]}, RefColumns: []*schema.Column{ControlsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "control_action_plans_action_plan_id", Columns: []*schema.Column{ControlActionPlansColumns[1]}, RefColumns: []*schema.Column{ActionPlansColumns[0]}, OnDelete: schema.Cascade, }, }, } // ControlTasksColumns holds the columns for the "control_tasks" table. ControlTasksColumns = []*schema.Column{ {Name: "control_id", Type: field.TypeString}, {Name: "task_id", Type: field.TypeString}, } // ControlTasksTable holds the schema information for the "control_tasks" table. ControlTasksTable = &schema.Table{ Name: "control_tasks", Columns: ControlTasksColumns, PrimaryKey: []*schema.Column{ControlTasksColumns[0], ControlTasksColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "control_tasks_control_id", Columns: []*schema.Column{ControlTasksColumns[0]}, RefColumns: []*schema.Column{ControlsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "control_tasks_task_id", Columns: []*schema.Column{ControlTasksColumns[1]}, RefColumns: []*schema.Column{TasksColumns[0]}, OnDelete: schema.Cascade, }, }, } // ControlObjectiveBlockedGroupsColumns holds the columns for the "control_objective_blocked_groups" table. ControlObjectiveBlockedGroupsColumns = []*schema.Column{ {Name: "control_objective_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // ControlObjectiveBlockedGroupsTable holds the schema information for the "control_objective_blocked_groups" table. ControlObjectiveBlockedGroupsTable = &schema.Table{ Name: "control_objective_blocked_groups", Columns: ControlObjectiveBlockedGroupsColumns, PrimaryKey: []*schema.Column{ControlObjectiveBlockedGroupsColumns[0], ControlObjectiveBlockedGroupsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "control_objective_blocked_groups_control_objective_id", Columns: []*schema.Column{ControlObjectiveBlockedGroupsColumns[0]}, RefColumns: []*schema.Column{ControlObjectivesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "control_objective_blocked_groups_group_id", Columns: []*schema.Column{ControlObjectiveBlockedGroupsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // ControlObjectiveEditorsColumns holds the columns for the "control_objective_editors" table. ControlObjectiveEditorsColumns = []*schema.Column{ {Name: "control_objective_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // ControlObjectiveEditorsTable holds the schema information for the "control_objective_editors" table. ControlObjectiveEditorsTable = &schema.Table{ Name: "control_objective_editors", Columns: ControlObjectiveEditorsColumns, PrimaryKey: []*schema.Column{ControlObjectiveEditorsColumns[0], ControlObjectiveEditorsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "control_objective_editors_control_objective_id", Columns: []*schema.Column{ControlObjectiveEditorsColumns[0]}, RefColumns: []*schema.Column{ControlObjectivesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "control_objective_editors_group_id", Columns: []*schema.Column{ControlObjectiveEditorsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // ControlObjectiveViewersColumns holds the columns for the "control_objective_viewers" table. ControlObjectiveViewersColumns = []*schema.Column{ {Name: "control_objective_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // ControlObjectiveViewersTable holds the schema information for the "control_objective_viewers" table. ControlObjectiveViewersTable = &schema.Table{ Name: "control_objective_viewers", Columns: ControlObjectiveViewersColumns, PrimaryKey: []*schema.Column{ControlObjectiveViewersColumns[0], ControlObjectiveViewersColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "control_objective_viewers_control_objective_id", Columns: []*schema.Column{ControlObjectiveViewersColumns[0]}, RefColumns: []*schema.Column{ControlObjectivesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "control_objective_viewers_group_id", Columns: []*schema.Column{ControlObjectiveViewersColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // ControlObjectiveNarrativesColumns holds the columns for the "control_objective_narratives" table. ControlObjectiveNarrativesColumns = []*schema.Column{ {Name: "control_objective_id", Type: field.TypeString}, {Name: "narrative_id", Type: field.TypeString}, } // ControlObjectiveNarrativesTable holds the schema information for the "control_objective_narratives" table. ControlObjectiveNarrativesTable = &schema.Table{ Name: "control_objective_narratives", Columns: ControlObjectiveNarrativesColumns, PrimaryKey: []*schema.Column{ControlObjectiveNarrativesColumns[0], ControlObjectiveNarrativesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "control_objective_narratives_control_objective_id", Columns: []*schema.Column{ControlObjectiveNarrativesColumns[0]}, RefColumns: []*schema.Column{ControlObjectivesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "control_objective_narratives_narrative_id", Columns: []*schema.Column{ControlObjectiveNarrativesColumns[1]}, RefColumns: []*schema.Column{NarrativesColumns[0]}, OnDelete: schema.Cascade, }, }, } // ControlObjectiveTasksColumns holds the columns for the "control_objective_tasks" table. ControlObjectiveTasksColumns = []*schema.Column{ {Name: "control_objective_id", Type: field.TypeString}, {Name: "task_id", Type: field.TypeString}, } // ControlObjectiveTasksTable holds the schema information for the "control_objective_tasks" table. ControlObjectiveTasksTable = &schema.Table{ Name: "control_objective_tasks", Columns: ControlObjectiveTasksColumns, PrimaryKey: []*schema.Column{ControlObjectiveTasksColumns[0], ControlObjectiveTasksColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "control_objective_tasks_control_objective_id", Columns: []*schema.Column{ControlObjectiveTasksColumns[0]}, RefColumns: []*schema.Column{ControlObjectivesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "control_objective_tasks_task_id", Columns: []*schema.Column{ControlObjectiveTasksColumns[1]}, RefColumns: []*schema.Column{TasksColumns[0]}, OnDelete: schema.Cascade, }, }, } // DocumentDataFilesColumns holds the columns for the "document_data_files" table. DocumentDataFilesColumns = []*schema.Column{ {Name: "document_data_id", Type: field.TypeString}, {Name: "file_id", Type: field.TypeString}, } // DocumentDataFilesTable holds the schema information for the "document_data_files" table. DocumentDataFilesTable = &schema.Table{ Name: "document_data_files", Columns: DocumentDataFilesColumns, PrimaryKey: []*schema.Column{DocumentDataFilesColumns[0], DocumentDataFilesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "document_data_files_document_data_id", Columns: []*schema.Column{DocumentDataFilesColumns[0]}, RefColumns: []*schema.Column{DocumentDataColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "document_data_files_file_id", Columns: []*schema.Column{DocumentDataFilesColumns[1]}, RefColumns: []*schema.Column{FilesColumns[0]}, OnDelete: schema.Cascade, }, }, } // EntityContactsColumns holds the columns for the "entity_contacts" table. EntityContactsColumns = []*schema.Column{ {Name: "entity_id", Type: field.TypeString}, {Name: "contact_id", Type: field.TypeString}, } // EntityContactsTable holds the schema information for the "entity_contacts" table. EntityContactsTable = &schema.Table{ Name: "entity_contacts", Columns: EntityContactsColumns, PrimaryKey: []*schema.Column{EntityContactsColumns[0], EntityContactsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "entity_contacts_entity_id", Columns: []*schema.Column{EntityContactsColumns[0]}, RefColumns: []*schema.Column{EntitiesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "entity_contacts_contact_id", Columns: []*schema.Column{EntityContactsColumns[1]}, RefColumns: []*schema.Column{ContactsColumns[0]}, OnDelete: schema.Cascade, }, }, } // EntityDocumentsColumns holds the columns for the "entity_documents" table. EntityDocumentsColumns = []*schema.Column{ {Name: "entity_id", Type: field.TypeString}, {Name: "document_data_id", Type: field.TypeString}, } // EntityDocumentsTable holds the schema information for the "entity_documents" table. EntityDocumentsTable = &schema.Table{ Name: "entity_documents", Columns: EntityDocumentsColumns, PrimaryKey: []*schema.Column{EntityDocumentsColumns[0], EntityDocumentsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "entity_documents_entity_id", Columns: []*schema.Column{EntityDocumentsColumns[0]}, RefColumns: []*schema.Column{EntitiesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "entity_documents_document_data_id", Columns: []*schema.Column{EntityDocumentsColumns[1]}, RefColumns: []*schema.Column{DocumentDataColumns[0]}, OnDelete: schema.Cascade, }, }, } // EntityFilesColumns holds the columns for the "entity_files" table. EntityFilesColumns = []*schema.Column{ {Name: "entity_id", Type: field.TypeString}, {Name: "file_id", Type: field.TypeString}, } // EntityFilesTable holds the schema information for the "entity_files" table. EntityFilesTable = &schema.Table{ Name: "entity_files", Columns: EntityFilesColumns, PrimaryKey: []*schema.Column{EntityFilesColumns[0], EntityFilesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "entity_files_entity_id", Columns: []*schema.Column{EntityFilesColumns[0]}, RefColumns: []*schema.Column{EntitiesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "entity_files_file_id", Columns: []*schema.Column{EntityFilesColumns[1]}, RefColumns: []*schema.Column{FilesColumns[0]}, OnDelete: schema.Cascade, }, }, } // FileEventsColumns holds the columns for the "file_events" table. FileEventsColumns = []*schema.Column{ {Name: "file_id", Type: field.TypeString}, {Name: "event_id", Type: field.TypeString}, } // FileEventsTable holds the schema information for the "file_events" table. FileEventsTable = &schema.Table{ Name: "file_events", Columns: FileEventsColumns, PrimaryKey: []*schema.Column{FileEventsColumns[0], FileEventsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "file_events_file_id", Columns: []*schema.Column{FileEventsColumns[0]}, RefColumns: []*schema.Column{FilesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "file_events_event_id", Columns: []*schema.Column{FileEventsColumns[1]}, RefColumns: []*schema.Column{EventsColumns[0]}, OnDelete: schema.Cascade, }, }, } // GroupEventsColumns holds the columns for the "group_events" table. GroupEventsColumns = []*schema.Column{ {Name: "group_id", Type: field.TypeString}, {Name: "event_id", Type: field.TypeString}, } // GroupEventsTable holds the schema information for the "group_events" table. GroupEventsTable = &schema.Table{ Name: "group_events", Columns: GroupEventsColumns, PrimaryKey: []*schema.Column{GroupEventsColumns[0], GroupEventsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "group_events_group_id", Columns: []*schema.Column{GroupEventsColumns[0]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "group_events_event_id", Columns: []*schema.Column{GroupEventsColumns[1]}, RefColumns: []*schema.Column{EventsColumns[0]}, OnDelete: schema.Cascade, }, }, } // GroupFilesColumns holds the columns for the "group_files" table. GroupFilesColumns = []*schema.Column{ {Name: "group_id", Type: field.TypeString}, {Name: "file_id", Type: field.TypeString}, } // GroupFilesTable holds the schema information for the "group_files" table. GroupFilesTable = &schema.Table{ Name: "group_files", Columns: GroupFilesColumns, PrimaryKey: []*schema.Column{GroupFilesColumns[0], GroupFilesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "group_files_group_id", Columns: []*schema.Column{GroupFilesColumns[0]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "group_files_file_id", Columns: []*schema.Column{GroupFilesColumns[1]}, RefColumns: []*schema.Column{FilesColumns[0]}, OnDelete: schema.Cascade, }, }, } // GroupTasksColumns holds the columns for the "group_tasks" table. GroupTasksColumns = []*schema.Column{ {Name: "group_id", Type: field.TypeString}, {Name: "task_id", Type: field.TypeString}, } // GroupTasksTable holds the schema information for the "group_tasks" table. GroupTasksTable = &schema.Table{ Name: "group_tasks", Columns: GroupTasksColumns, PrimaryKey: []*schema.Column{GroupTasksColumns[0], GroupTasksColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "group_tasks_group_id", Columns: []*schema.Column{GroupTasksColumns[0]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "group_tasks_task_id", Columns: []*schema.Column{GroupTasksColumns[1]}, RefColumns: []*schema.Column{TasksColumns[0]}, OnDelete: schema.Cascade, }, }, } // GroupMembershipEventsColumns holds the columns for the "group_membership_events" table. GroupMembershipEventsColumns = []*schema.Column{ {Name: "group_membership_id", Type: field.TypeString}, {Name: "event_id", Type: field.TypeString}, } // GroupMembershipEventsTable holds the schema information for the "group_membership_events" table. GroupMembershipEventsTable = &schema.Table{ Name: "group_membership_events", Columns: GroupMembershipEventsColumns, PrimaryKey: []*schema.Column{GroupMembershipEventsColumns[0], GroupMembershipEventsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "group_membership_events_group_membership_id", Columns: []*schema.Column{GroupMembershipEventsColumns[0]}, RefColumns: []*schema.Column{GroupMembershipsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "group_membership_events_event_id", Columns: []*schema.Column{GroupMembershipEventsColumns[1]}, RefColumns: []*schema.Column{EventsColumns[0]}, OnDelete: schema.Cascade, }, }, } // HushEventsColumns holds the columns for the "hush_events" table. HushEventsColumns = []*schema.Column{ {Name: "hush_id", Type: field.TypeString}, {Name: "event_id", Type: field.TypeString}, } // HushEventsTable holds the schema information for the "hush_events" table. HushEventsTable = &schema.Table{ Name: "hush_events", Columns: HushEventsColumns, PrimaryKey: []*schema.Column{HushEventsColumns[0], HushEventsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "hush_events_hush_id", Columns: []*schema.Column{HushEventsColumns[0]}, RefColumns: []*schema.Column{HushesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "hush_events_event_id", Columns: []*schema.Column{HushEventsColumns[1]}, RefColumns: []*schema.Column{EventsColumns[0]}, OnDelete: schema.Cascade, }, }, } // IntegrationSecretsColumns holds the columns for the "integration_secrets" table. IntegrationSecretsColumns = []*schema.Column{ {Name: "integration_id", Type: field.TypeString}, {Name: "hush_id", Type: field.TypeString}, } // IntegrationSecretsTable holds the schema information for the "integration_secrets" table. IntegrationSecretsTable = &schema.Table{ Name: "integration_secrets", Columns: IntegrationSecretsColumns, PrimaryKey: []*schema.Column{IntegrationSecretsColumns[0], IntegrationSecretsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "integration_secrets_integration_id", Columns: []*schema.Column{IntegrationSecretsColumns[0]}, RefColumns: []*schema.Column{IntegrationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "integration_secrets_hush_id", Columns: []*schema.Column{IntegrationSecretsColumns[1]}, RefColumns: []*schema.Column{HushesColumns[0]}, OnDelete: schema.Cascade, }, }, } // IntegrationEventsColumns holds the columns for the "integration_events" table. IntegrationEventsColumns = []*schema.Column{ {Name: "integration_id", Type: field.TypeString}, {Name: "event_id", Type: field.TypeString}, } // IntegrationEventsTable holds the schema information for the "integration_events" table. IntegrationEventsTable = &schema.Table{ Name: "integration_events", Columns: IntegrationEventsColumns, PrimaryKey: []*schema.Column{IntegrationEventsColumns[0], IntegrationEventsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "integration_events_integration_id", Columns: []*schema.Column{IntegrationEventsColumns[0]}, RefColumns: []*schema.Column{IntegrationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "integration_events_event_id", Columns: []*schema.Column{IntegrationEventsColumns[1]}, RefColumns: []*schema.Column{EventsColumns[0]}, OnDelete: schema.Cascade, }, }, } // InternalPolicyBlockedGroupsColumns holds the columns for the "internal_policy_blocked_groups" table. InternalPolicyBlockedGroupsColumns = []*schema.Column{ {Name: "internal_policy_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // InternalPolicyBlockedGroupsTable holds the schema information for the "internal_policy_blocked_groups" table. InternalPolicyBlockedGroupsTable = &schema.Table{ Name: "internal_policy_blocked_groups", Columns: InternalPolicyBlockedGroupsColumns, PrimaryKey: []*schema.Column{InternalPolicyBlockedGroupsColumns[0], InternalPolicyBlockedGroupsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "internal_policy_blocked_groups_internal_policy_id", Columns: []*schema.Column{InternalPolicyBlockedGroupsColumns[0]}, RefColumns: []*schema.Column{InternalPoliciesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "internal_policy_blocked_groups_group_id", Columns: []*schema.Column{InternalPolicyBlockedGroupsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // InternalPolicyEditorsColumns holds the columns for the "internal_policy_editors" table. InternalPolicyEditorsColumns = []*schema.Column{ {Name: "internal_policy_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // InternalPolicyEditorsTable holds the schema information for the "internal_policy_editors" table. InternalPolicyEditorsTable = &schema.Table{ Name: "internal_policy_editors", Columns: InternalPolicyEditorsColumns, PrimaryKey: []*schema.Column{InternalPolicyEditorsColumns[0], InternalPolicyEditorsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "internal_policy_editors_internal_policy_id", Columns: []*schema.Column{InternalPolicyEditorsColumns[0]}, RefColumns: []*schema.Column{InternalPoliciesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "internal_policy_editors_group_id", Columns: []*schema.Column{InternalPolicyEditorsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // InternalPolicyControlObjectivesColumns holds the columns for the "internal_policy_control_objectives" table. InternalPolicyControlObjectivesColumns = []*schema.Column{ {Name: "internal_policy_id", Type: field.TypeString}, {Name: "control_objective_id", Type: field.TypeString}, } // InternalPolicyControlObjectivesTable holds the schema information for the "internal_policy_control_objectives" table. InternalPolicyControlObjectivesTable = &schema.Table{ Name: "internal_policy_control_objectives", Columns: InternalPolicyControlObjectivesColumns, PrimaryKey: []*schema.Column{InternalPolicyControlObjectivesColumns[0], InternalPolicyControlObjectivesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "internal_policy_control_objectives_internal_policy_id", Columns: []*schema.Column{InternalPolicyControlObjectivesColumns[0]}, RefColumns: []*schema.Column{InternalPoliciesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "internal_policy_control_objectives_control_objective_id", Columns: []*schema.Column{InternalPolicyControlObjectivesColumns[1]}, RefColumns: []*schema.Column{ControlObjectivesColumns[0]}, OnDelete: schema.Cascade, }, }, } // InternalPolicyProceduresColumns holds the columns for the "internal_policy_procedures" table. InternalPolicyProceduresColumns = []*schema.Column{ {Name: "internal_policy_id", Type: field.TypeString}, {Name: "procedure_id", Type: field.TypeString}, } // InternalPolicyProceduresTable holds the schema information for the "internal_policy_procedures" table. InternalPolicyProceduresTable = &schema.Table{ Name: "internal_policy_procedures", Columns: InternalPolicyProceduresColumns, PrimaryKey: []*schema.Column{InternalPolicyProceduresColumns[0], InternalPolicyProceduresColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "internal_policy_procedures_internal_policy_id", Columns: []*schema.Column{InternalPolicyProceduresColumns[0]}, RefColumns: []*schema.Column{InternalPoliciesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "internal_policy_procedures_procedure_id", Columns: []*schema.Column{InternalPolicyProceduresColumns[1]}, RefColumns: []*schema.Column{ProceduresColumns[0]}, OnDelete: schema.Cascade, }, }, } // InternalPolicyNarrativesColumns holds the columns for the "internal_policy_narratives" table. InternalPolicyNarrativesColumns = []*schema.Column{ {Name: "internal_policy_id", Type: field.TypeString}, {Name: "narrative_id", Type: field.TypeString}, } // InternalPolicyNarrativesTable holds the schema information for the "internal_policy_narratives" table. InternalPolicyNarrativesTable = &schema.Table{ Name: "internal_policy_narratives", Columns: InternalPolicyNarrativesColumns, PrimaryKey: []*schema.Column{InternalPolicyNarrativesColumns[0], InternalPolicyNarrativesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "internal_policy_narratives_internal_policy_id", Columns: []*schema.Column{InternalPolicyNarrativesColumns[0]}, RefColumns: []*schema.Column{InternalPoliciesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "internal_policy_narratives_narrative_id", Columns: []*schema.Column{InternalPolicyNarrativesColumns[1]}, RefColumns: []*schema.Column{NarrativesColumns[0]}, OnDelete: schema.Cascade, }, }, } // InternalPolicyTasksColumns holds the columns for the "internal_policy_tasks" table. InternalPolicyTasksColumns = []*schema.Column{ {Name: "internal_policy_id", Type: field.TypeString}, {Name: "task_id", Type: field.TypeString}, } // InternalPolicyTasksTable holds the schema information for the "internal_policy_tasks" table. InternalPolicyTasksTable = &schema.Table{ Name: "internal_policy_tasks", Columns: InternalPolicyTasksColumns, PrimaryKey: []*schema.Column{InternalPolicyTasksColumns[0], InternalPolicyTasksColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "internal_policy_tasks_internal_policy_id", Columns: []*schema.Column{InternalPolicyTasksColumns[0]}, RefColumns: []*schema.Column{InternalPoliciesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "internal_policy_tasks_task_id", Columns: []*schema.Column{InternalPolicyTasksColumns[1]}, RefColumns: []*schema.Column{TasksColumns[0]}, OnDelete: schema.Cascade, }, }, } // InviteEventsColumns holds the columns for the "invite_events" table. InviteEventsColumns = []*schema.Column{ {Name: "invite_id", Type: field.TypeString}, {Name: "event_id", Type: field.TypeString}, } // InviteEventsTable holds the schema information for the "invite_events" table. InviteEventsTable = &schema.Table{ Name: "invite_events", Columns: InviteEventsColumns, PrimaryKey: []*schema.Column{InviteEventsColumns[0], InviteEventsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "invite_events_invite_id", Columns: []*schema.Column{InviteEventsColumns[0]}, RefColumns: []*schema.Column{InvitesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "invite_events_event_id", Columns: []*schema.Column{InviteEventsColumns[1]}, RefColumns: []*schema.Column{EventsColumns[0]}, OnDelete: schema.Cascade, }, }, } // NarrativeBlockedGroupsColumns holds the columns for the "narrative_blocked_groups" table. NarrativeBlockedGroupsColumns = []*schema.Column{ {Name: "narrative_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // NarrativeBlockedGroupsTable holds the schema information for the "narrative_blocked_groups" table. NarrativeBlockedGroupsTable = &schema.Table{ Name: "narrative_blocked_groups", Columns: NarrativeBlockedGroupsColumns, PrimaryKey: []*schema.Column{NarrativeBlockedGroupsColumns[0], NarrativeBlockedGroupsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "narrative_blocked_groups_narrative_id", Columns: []*schema.Column{NarrativeBlockedGroupsColumns[0]}, RefColumns: []*schema.Column{NarrativesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "narrative_blocked_groups_group_id", Columns: []*schema.Column{NarrativeBlockedGroupsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // NarrativeEditorsColumns holds the columns for the "narrative_editors" table. NarrativeEditorsColumns = []*schema.Column{ {Name: "narrative_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // NarrativeEditorsTable holds the schema information for the "narrative_editors" table. NarrativeEditorsTable = &schema.Table{ Name: "narrative_editors", Columns: NarrativeEditorsColumns, PrimaryKey: []*schema.Column{NarrativeEditorsColumns[0], NarrativeEditorsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "narrative_editors_narrative_id", Columns: []*schema.Column{NarrativeEditorsColumns[0]}, RefColumns: []*schema.Column{NarrativesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "narrative_editors_group_id", Columns: []*schema.Column{NarrativeEditorsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // NarrativeViewersColumns holds the columns for the "narrative_viewers" table. NarrativeViewersColumns = []*schema.Column{ {Name: "narrative_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // NarrativeViewersTable holds the schema information for the "narrative_viewers" table. NarrativeViewersTable = &schema.Table{ Name: "narrative_viewers", Columns: NarrativeViewersColumns, PrimaryKey: []*schema.Column{NarrativeViewersColumns[0], NarrativeViewersColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "narrative_viewers_narrative_id", Columns: []*schema.Column{NarrativeViewersColumns[0]}, RefColumns: []*schema.Column{NarrativesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "narrative_viewers_group_id", Columns: []*schema.Column{NarrativeViewersColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // OrgMembershipEventsColumns holds the columns for the "org_membership_events" table. OrgMembershipEventsColumns = []*schema.Column{ {Name: "org_membership_id", Type: field.TypeString}, {Name: "event_id", Type: field.TypeString}, } // OrgMembershipEventsTable holds the schema information for the "org_membership_events" table. OrgMembershipEventsTable = &schema.Table{ Name: "org_membership_events", Columns: OrgMembershipEventsColumns, PrimaryKey: []*schema.Column{OrgMembershipEventsColumns[0], OrgMembershipEventsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "org_membership_events_org_membership_id", Columns: []*schema.Column{OrgMembershipEventsColumns[0]}, RefColumns: []*schema.Column{OrgMembershipsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "org_membership_events_event_id", Columns: []*schema.Column{OrgMembershipEventsColumns[1]}, RefColumns: []*schema.Column{EventsColumns[0]}, OnDelete: schema.Cascade, }, }, } // OrganizationControlCreatorsColumns holds the columns for the "organization_control_creators" table. OrganizationControlCreatorsColumns = []*schema.Column{ {Name: "organization_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // OrganizationControlCreatorsTable holds the schema information for the "organization_control_creators" table. OrganizationControlCreatorsTable = &schema.Table{ Name: "organization_control_creators", Columns: OrganizationControlCreatorsColumns, PrimaryKey: []*schema.Column{OrganizationControlCreatorsColumns[0], OrganizationControlCreatorsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organization_control_creators_organization_id", Columns: []*schema.Column{OrganizationControlCreatorsColumns[0]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "organization_control_creators_group_id", Columns: []*schema.Column{OrganizationControlCreatorsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // OrganizationControlObjectiveCreatorsColumns holds the columns for the "organization_control_objective_creators" table. OrganizationControlObjectiveCreatorsColumns = []*schema.Column{ {Name: "organization_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // OrganizationControlObjectiveCreatorsTable holds the schema information for the "organization_control_objective_creators" table. OrganizationControlObjectiveCreatorsTable = &schema.Table{ Name: "organization_control_objective_creators", Columns: OrganizationControlObjectiveCreatorsColumns, PrimaryKey: []*schema.Column{OrganizationControlObjectiveCreatorsColumns[0], OrganizationControlObjectiveCreatorsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organization_control_objective_creators_organization_id", Columns: []*schema.Column{OrganizationControlObjectiveCreatorsColumns[0]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "organization_control_objective_creators_group_id", Columns: []*schema.Column{OrganizationControlObjectiveCreatorsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // OrganizationGroupCreatorsColumns holds the columns for the "organization_group_creators" table. OrganizationGroupCreatorsColumns = []*schema.Column{ {Name: "organization_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // OrganizationGroupCreatorsTable holds the schema information for the "organization_group_creators" table. OrganizationGroupCreatorsTable = &schema.Table{ Name: "organization_group_creators", Columns: OrganizationGroupCreatorsColumns, PrimaryKey: []*schema.Column{OrganizationGroupCreatorsColumns[0], OrganizationGroupCreatorsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organization_group_creators_organization_id", Columns: []*schema.Column{OrganizationGroupCreatorsColumns[0]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "organization_group_creators_group_id", Columns: []*schema.Column{OrganizationGroupCreatorsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // OrganizationInternalPolicyCreatorsColumns holds the columns for the "organization_internal_policy_creators" table. OrganizationInternalPolicyCreatorsColumns = []*schema.Column{ {Name: "organization_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // OrganizationInternalPolicyCreatorsTable holds the schema information for the "organization_internal_policy_creators" table. OrganizationInternalPolicyCreatorsTable = &schema.Table{ Name: "organization_internal_policy_creators", Columns: OrganizationInternalPolicyCreatorsColumns, PrimaryKey: []*schema.Column{OrganizationInternalPolicyCreatorsColumns[0], OrganizationInternalPolicyCreatorsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organization_internal_policy_creators_organization_id", Columns: []*schema.Column{OrganizationInternalPolicyCreatorsColumns[0]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "organization_internal_policy_creators_group_id", Columns: []*schema.Column{OrganizationInternalPolicyCreatorsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // OrganizationNarrativeCreatorsColumns holds the columns for the "organization_narrative_creators" table. OrganizationNarrativeCreatorsColumns = []*schema.Column{ {Name: "organization_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // OrganizationNarrativeCreatorsTable holds the schema information for the "organization_narrative_creators" table. OrganizationNarrativeCreatorsTable = &schema.Table{ Name: "organization_narrative_creators", Columns: OrganizationNarrativeCreatorsColumns, PrimaryKey: []*schema.Column{OrganizationNarrativeCreatorsColumns[0], OrganizationNarrativeCreatorsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organization_narrative_creators_organization_id", Columns: []*schema.Column{OrganizationNarrativeCreatorsColumns[0]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "organization_narrative_creators_group_id", Columns: []*schema.Column{OrganizationNarrativeCreatorsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // OrganizationProcedureCreatorsColumns holds the columns for the "organization_procedure_creators" table. OrganizationProcedureCreatorsColumns = []*schema.Column{ {Name: "organization_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // OrganizationProcedureCreatorsTable holds the schema information for the "organization_procedure_creators" table. OrganizationProcedureCreatorsTable = &schema.Table{ Name: "organization_procedure_creators", Columns: OrganizationProcedureCreatorsColumns, PrimaryKey: []*schema.Column{OrganizationProcedureCreatorsColumns[0], OrganizationProcedureCreatorsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organization_procedure_creators_organization_id", Columns: []*schema.Column{OrganizationProcedureCreatorsColumns[0]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "organization_procedure_creators_group_id", Columns: []*schema.Column{OrganizationProcedureCreatorsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // OrganizationProgramCreatorsColumns holds the columns for the "organization_program_creators" table. OrganizationProgramCreatorsColumns = []*schema.Column{ {Name: "organization_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // OrganizationProgramCreatorsTable holds the schema information for the "organization_program_creators" table. OrganizationProgramCreatorsTable = &schema.Table{ Name: "organization_program_creators", Columns: OrganizationProgramCreatorsColumns, PrimaryKey: []*schema.Column{OrganizationProgramCreatorsColumns[0], OrganizationProgramCreatorsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organization_program_creators_organization_id", Columns: []*schema.Column{OrganizationProgramCreatorsColumns[0]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "organization_program_creators_group_id", Columns: []*schema.Column{OrganizationProgramCreatorsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // OrganizationRiskCreatorsColumns holds the columns for the "organization_risk_creators" table. OrganizationRiskCreatorsColumns = []*schema.Column{ {Name: "organization_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // OrganizationRiskCreatorsTable holds the schema information for the "organization_risk_creators" table. OrganizationRiskCreatorsTable = &schema.Table{ Name: "organization_risk_creators", Columns: OrganizationRiskCreatorsColumns, PrimaryKey: []*schema.Column{OrganizationRiskCreatorsColumns[0], OrganizationRiskCreatorsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organization_risk_creators_organization_id", Columns: []*schema.Column{OrganizationRiskCreatorsColumns[0]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "organization_risk_creators_group_id", Columns: []*schema.Column{OrganizationRiskCreatorsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // OrganizationTemplateCreatorsColumns holds the columns for the "organization_template_creators" table. OrganizationTemplateCreatorsColumns = []*schema.Column{ {Name: "organization_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // OrganizationTemplateCreatorsTable holds the schema information for the "organization_template_creators" table. OrganizationTemplateCreatorsTable = &schema.Table{ Name: "organization_template_creators", Columns: OrganizationTemplateCreatorsColumns, PrimaryKey: []*schema.Column{OrganizationTemplateCreatorsColumns[0], OrganizationTemplateCreatorsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organization_template_creators_organization_id", Columns: []*schema.Column{OrganizationTemplateCreatorsColumns[0]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "organization_template_creators_group_id", Columns: []*schema.Column{OrganizationTemplateCreatorsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // OrganizationPersonalAccessTokensColumns holds the columns for the "organization_personal_access_tokens" table. OrganizationPersonalAccessTokensColumns = []*schema.Column{ {Name: "organization_id", Type: field.TypeString}, {Name: "personal_access_token_id", Type: field.TypeString}, } // OrganizationPersonalAccessTokensTable holds the schema information for the "organization_personal_access_tokens" table. OrganizationPersonalAccessTokensTable = &schema.Table{ Name: "organization_personal_access_tokens", Columns: OrganizationPersonalAccessTokensColumns, PrimaryKey: []*schema.Column{OrganizationPersonalAccessTokensColumns[0], OrganizationPersonalAccessTokensColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organization_personal_access_tokens_organization_id", Columns: []*schema.Column{OrganizationPersonalAccessTokensColumns[0]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "organization_personal_access_tokens_personal_access_token_id", Columns: []*schema.Column{OrganizationPersonalAccessTokensColumns[1]}, RefColumns: []*schema.Column{PersonalAccessTokensColumns[0]}, OnDelete: schema.Cascade, }, }, } // OrganizationEventsColumns holds the columns for the "organization_events" table. OrganizationEventsColumns = []*schema.Column{ {Name: "organization_id", Type: field.TypeString}, {Name: "event_id", Type: field.TypeString}, } // OrganizationEventsTable holds the schema information for the "organization_events" table. OrganizationEventsTable = &schema.Table{ Name: "organization_events", Columns: OrganizationEventsColumns, PrimaryKey: []*schema.Column{OrganizationEventsColumns[0], OrganizationEventsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organization_events_organization_id", Columns: []*schema.Column{OrganizationEventsColumns[0]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "organization_events_event_id", Columns: []*schema.Column{OrganizationEventsColumns[1]}, RefColumns: []*schema.Column{EventsColumns[0]}, OnDelete: schema.Cascade, }, }, } // OrganizationSecretsColumns holds the columns for the "organization_secrets" table. OrganizationSecretsColumns = []*schema.Column{ {Name: "organization_id", Type: field.TypeString}, {Name: "hush_id", Type: field.TypeString}, } // OrganizationSecretsTable holds the schema information for the "organization_secrets" table. OrganizationSecretsTable = &schema.Table{ Name: "organization_secrets", Columns: OrganizationSecretsColumns, PrimaryKey: []*schema.Column{OrganizationSecretsColumns[0], OrganizationSecretsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organization_secrets_organization_id", Columns: []*schema.Column{OrganizationSecretsColumns[0]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "organization_secrets_hush_id", Columns: []*schema.Column{OrganizationSecretsColumns[1]}, RefColumns: []*schema.Column{HushesColumns[0]}, OnDelete: schema.Cascade, }, }, } // OrganizationFilesColumns holds the columns for the "organization_files" table. OrganizationFilesColumns = []*schema.Column{ {Name: "organization_id", Type: field.TypeString}, {Name: "file_id", Type: field.TypeString}, } // OrganizationFilesTable holds the schema information for the "organization_files" table. OrganizationFilesTable = &schema.Table{ Name: "organization_files", Columns: OrganizationFilesColumns, PrimaryKey: []*schema.Column{OrganizationFilesColumns[0], OrganizationFilesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organization_files_organization_id", Columns: []*schema.Column{OrganizationFilesColumns[0]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "organization_files_file_id", Columns: []*schema.Column{OrganizationFilesColumns[1]}, RefColumns: []*schema.Column{FilesColumns[0]}, OnDelete: schema.Cascade, }, }, } // OrganizationTasksColumns holds the columns for the "organization_tasks" table. OrganizationTasksColumns = []*schema.Column{ {Name: "organization_id", Type: field.TypeString}, {Name: "task_id", Type: field.TypeString}, } // OrganizationTasksTable holds the schema information for the "organization_tasks" table. OrganizationTasksTable = &schema.Table{ Name: "organization_tasks", Columns: OrganizationTasksColumns, PrimaryKey: []*schema.Column{OrganizationTasksColumns[0], OrganizationTasksColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organization_tasks_organization_id", Columns: []*schema.Column{OrganizationTasksColumns[0]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "organization_tasks_task_id", Columns: []*schema.Column{OrganizationTasksColumns[1]}, RefColumns: []*schema.Column{TasksColumns[0]}, OnDelete: schema.Cascade, }, }, } // OrganizationSettingFilesColumns holds the columns for the "organization_setting_files" table. OrganizationSettingFilesColumns = []*schema.Column{ {Name: "organization_setting_id", Type: field.TypeString}, {Name: "file_id", Type: field.TypeString}, } // OrganizationSettingFilesTable holds the schema information for the "organization_setting_files" table. OrganizationSettingFilesTable = &schema.Table{ Name: "organization_setting_files", Columns: OrganizationSettingFilesColumns, PrimaryKey: []*schema.Column{OrganizationSettingFilesColumns[0], OrganizationSettingFilesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organization_setting_files_organization_setting_id", Columns: []*schema.Column{OrganizationSettingFilesColumns[0]}, RefColumns: []*schema.Column{OrganizationSettingsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "organization_setting_files_file_id", Columns: []*schema.Column{OrganizationSettingFilesColumns[1]}, RefColumns: []*schema.Column{FilesColumns[0]}, OnDelete: schema.Cascade, }, }, } // PersonalAccessTokenEventsColumns holds the columns for the "personal_access_token_events" table. PersonalAccessTokenEventsColumns = []*schema.Column{ {Name: "personal_access_token_id", Type: field.TypeString}, {Name: "event_id", Type: field.TypeString}, } // PersonalAccessTokenEventsTable holds the schema information for the "personal_access_token_events" table. PersonalAccessTokenEventsTable = &schema.Table{ Name: "personal_access_token_events", Columns: PersonalAccessTokenEventsColumns, PrimaryKey: []*schema.Column{PersonalAccessTokenEventsColumns[0], PersonalAccessTokenEventsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "personal_access_token_events_personal_access_token_id", Columns: []*schema.Column{PersonalAccessTokenEventsColumns[0]}, RefColumns: []*schema.Column{PersonalAccessTokensColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "personal_access_token_events_event_id", Columns: []*schema.Column{PersonalAccessTokenEventsColumns[1]}, RefColumns: []*schema.Column{EventsColumns[0]}, OnDelete: schema.Cascade, }, }, } // ProcedureBlockedGroupsColumns holds the columns for the "procedure_blocked_groups" table. ProcedureBlockedGroupsColumns = []*schema.Column{ {Name: "procedure_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // ProcedureBlockedGroupsTable holds the schema information for the "procedure_blocked_groups" table. ProcedureBlockedGroupsTable = &schema.Table{ Name: "procedure_blocked_groups", Columns: ProcedureBlockedGroupsColumns, PrimaryKey: []*schema.Column{ProcedureBlockedGroupsColumns[0], ProcedureBlockedGroupsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "procedure_blocked_groups_procedure_id", Columns: []*schema.Column{ProcedureBlockedGroupsColumns[0]}, RefColumns: []*schema.Column{ProceduresColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "procedure_blocked_groups_group_id", Columns: []*schema.Column{ProcedureBlockedGroupsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // ProcedureEditorsColumns holds the columns for the "procedure_editors" table. ProcedureEditorsColumns = []*schema.Column{ {Name: "procedure_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // ProcedureEditorsTable holds the schema information for the "procedure_editors" table. ProcedureEditorsTable = &schema.Table{ Name: "procedure_editors", Columns: ProcedureEditorsColumns, PrimaryKey: []*schema.Column{ProcedureEditorsColumns[0], ProcedureEditorsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "procedure_editors_procedure_id", Columns: []*schema.Column{ProcedureEditorsColumns[0]}, RefColumns: []*schema.Column{ProceduresColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "procedure_editors_group_id", Columns: []*schema.Column{ProcedureEditorsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // ProcedureNarrativesColumns holds the columns for the "procedure_narratives" table. ProcedureNarrativesColumns = []*schema.Column{ {Name: "procedure_id", Type: field.TypeString}, {Name: "narrative_id", Type: field.TypeString}, } // ProcedureNarrativesTable holds the schema information for the "procedure_narratives" table. ProcedureNarrativesTable = &schema.Table{ Name: "procedure_narratives", Columns: ProcedureNarrativesColumns, PrimaryKey: []*schema.Column{ProcedureNarrativesColumns[0], ProcedureNarrativesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "procedure_narratives_procedure_id", Columns: []*schema.Column{ProcedureNarrativesColumns[0]}, RefColumns: []*schema.Column{ProceduresColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "procedure_narratives_narrative_id", Columns: []*schema.Column{ProcedureNarrativesColumns[1]}, RefColumns: []*schema.Column{NarrativesColumns[0]}, OnDelete: schema.Cascade, }, }, } // ProcedureRisksColumns holds the columns for the "procedure_risks" table. ProcedureRisksColumns = []*schema.Column{ {Name: "procedure_id", Type: field.TypeString}, {Name: "risk_id", Type: field.TypeString}, } // ProcedureRisksTable holds the schema information for the "procedure_risks" table. ProcedureRisksTable = &schema.Table{ Name: "procedure_risks", Columns: ProcedureRisksColumns, PrimaryKey: []*schema.Column{ProcedureRisksColumns[0], ProcedureRisksColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "procedure_risks_procedure_id", Columns: []*schema.Column{ProcedureRisksColumns[0]}, RefColumns: []*schema.Column{ProceduresColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "procedure_risks_risk_id", Columns: []*schema.Column{ProcedureRisksColumns[1]}, RefColumns: []*schema.Column{RisksColumns[0]}, OnDelete: schema.Cascade, }, }, } // ProcedureTasksColumns holds the columns for the "procedure_tasks" table. ProcedureTasksColumns = []*schema.Column{ {Name: "procedure_id", Type: field.TypeString}, {Name: "task_id", Type: field.TypeString}, } // ProcedureTasksTable holds the schema information for the "procedure_tasks" table. ProcedureTasksTable = &schema.Table{ Name: "procedure_tasks", Columns: ProcedureTasksColumns, PrimaryKey: []*schema.Column{ProcedureTasksColumns[0], ProcedureTasksColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "procedure_tasks_procedure_id", Columns: []*schema.Column{ProcedureTasksColumns[0]}, RefColumns: []*schema.Column{ProceduresColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "procedure_tasks_task_id", Columns: []*schema.Column{ProcedureTasksColumns[1]}, RefColumns: []*schema.Column{TasksColumns[0]}, OnDelete: schema.Cascade, }, }, } // ProgramBlockedGroupsColumns holds the columns for the "program_blocked_groups" table. ProgramBlockedGroupsColumns = []*schema.Column{ {Name: "program_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // ProgramBlockedGroupsTable holds the schema information for the "program_blocked_groups" table. ProgramBlockedGroupsTable = &schema.Table{ Name: "program_blocked_groups", Columns: ProgramBlockedGroupsColumns, PrimaryKey: []*schema.Column{ProgramBlockedGroupsColumns[0], ProgramBlockedGroupsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "program_blocked_groups_program_id", Columns: []*schema.Column{ProgramBlockedGroupsColumns[0]}, RefColumns: []*schema.Column{ProgramsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "program_blocked_groups_group_id", Columns: []*schema.Column{ProgramBlockedGroupsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // ProgramEditorsColumns holds the columns for the "program_editors" table. ProgramEditorsColumns = []*schema.Column{ {Name: "program_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // ProgramEditorsTable holds the schema information for the "program_editors" table. ProgramEditorsTable = &schema.Table{ Name: "program_editors", Columns: ProgramEditorsColumns, PrimaryKey: []*schema.Column{ProgramEditorsColumns[0], ProgramEditorsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "program_editors_program_id", Columns: []*schema.Column{ProgramEditorsColumns[0]}, RefColumns: []*schema.Column{ProgramsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "program_editors_group_id", Columns: []*schema.Column{ProgramEditorsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // ProgramViewersColumns holds the columns for the "program_viewers" table. ProgramViewersColumns = []*schema.Column{ {Name: "program_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // ProgramViewersTable holds the schema information for the "program_viewers" table. ProgramViewersTable = &schema.Table{ Name: "program_viewers", Columns: ProgramViewersColumns, PrimaryKey: []*schema.Column{ProgramViewersColumns[0], ProgramViewersColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "program_viewers_program_id", Columns: []*schema.Column{ProgramViewersColumns[0]}, RefColumns: []*schema.Column{ProgramsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "program_viewers_group_id", Columns: []*schema.Column{ProgramViewersColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // ProgramControlsColumns holds the columns for the "program_controls" table. ProgramControlsColumns = []*schema.Column{ {Name: "program_id", Type: field.TypeString}, {Name: "control_id", Type: field.TypeString}, } // ProgramControlsTable holds the schema information for the "program_controls" table. ProgramControlsTable = &schema.Table{ Name: "program_controls", Columns: ProgramControlsColumns, PrimaryKey: []*schema.Column{ProgramControlsColumns[0], ProgramControlsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "program_controls_program_id", Columns: []*schema.Column{ProgramControlsColumns[0]}, RefColumns: []*schema.Column{ProgramsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "program_controls_control_id", Columns: []*schema.Column{ProgramControlsColumns[1]}, RefColumns: []*schema.Column{ControlsColumns[0]}, OnDelete: schema.Cascade, }, }, } // ProgramSubcontrolsColumns holds the columns for the "program_subcontrols" table. ProgramSubcontrolsColumns = []*schema.Column{ {Name: "program_id", Type: field.TypeString}, {Name: "subcontrol_id", Type: field.TypeString}, } // ProgramSubcontrolsTable holds the schema information for the "program_subcontrols" table. ProgramSubcontrolsTable = &schema.Table{ Name: "program_subcontrols", Columns: ProgramSubcontrolsColumns, PrimaryKey: []*schema.Column{ProgramSubcontrolsColumns[0], ProgramSubcontrolsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "program_subcontrols_program_id", Columns: []*schema.Column{ProgramSubcontrolsColumns[0]}, RefColumns: []*schema.Column{ProgramsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "program_subcontrols_subcontrol_id", Columns: []*schema.Column{ProgramSubcontrolsColumns[1]}, RefColumns: []*schema.Column{SubcontrolsColumns[0]}, OnDelete: schema.Cascade, }, }, } // ProgramControlObjectivesColumns holds the columns for the "program_control_objectives" table. ProgramControlObjectivesColumns = []*schema.Column{ {Name: "program_id", Type: field.TypeString}, {Name: "control_objective_id", Type: field.TypeString}, } // ProgramControlObjectivesTable holds the schema information for the "program_control_objectives" table. ProgramControlObjectivesTable = &schema.Table{ Name: "program_control_objectives", Columns: ProgramControlObjectivesColumns, PrimaryKey: []*schema.Column{ProgramControlObjectivesColumns[0], ProgramControlObjectivesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "program_control_objectives_program_id", Columns: []*schema.Column{ProgramControlObjectivesColumns[0]}, RefColumns: []*schema.Column{ProgramsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "program_control_objectives_control_objective_id", Columns: []*schema.Column{ProgramControlObjectivesColumns[1]}, RefColumns: []*schema.Column{ControlObjectivesColumns[0]}, OnDelete: schema.Cascade, }, }, } // ProgramInternalPoliciesColumns holds the columns for the "program_internal_policies" table. ProgramInternalPoliciesColumns = []*schema.Column{ {Name: "program_id", Type: field.TypeString}, {Name: "internal_policy_id", Type: field.TypeString}, } // ProgramInternalPoliciesTable holds the schema information for the "program_internal_policies" table. ProgramInternalPoliciesTable = &schema.Table{ Name: "program_internal_policies", Columns: ProgramInternalPoliciesColumns, PrimaryKey: []*schema.Column{ProgramInternalPoliciesColumns[0], ProgramInternalPoliciesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "program_internal_policies_program_id", Columns: []*schema.Column{ProgramInternalPoliciesColumns[0]}, RefColumns: []*schema.Column{ProgramsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "program_internal_policies_internal_policy_id", Columns: []*schema.Column{ProgramInternalPoliciesColumns[1]}, RefColumns: []*schema.Column{InternalPoliciesColumns[0]}, OnDelete: schema.Cascade, }, }, } // ProgramProceduresColumns holds the columns for the "program_procedures" table. ProgramProceduresColumns = []*schema.Column{ {Name: "program_id", Type: field.TypeString}, {Name: "procedure_id", Type: field.TypeString}, } // ProgramProceduresTable holds the schema information for the "program_procedures" table. ProgramProceduresTable = &schema.Table{ Name: "program_procedures", Columns: ProgramProceduresColumns, PrimaryKey: []*schema.Column{ProgramProceduresColumns[0], ProgramProceduresColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "program_procedures_program_id", Columns: []*schema.Column{ProgramProceduresColumns[0]}, RefColumns: []*schema.Column{ProgramsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "program_procedures_procedure_id", Columns: []*schema.Column{ProgramProceduresColumns[1]}, RefColumns: []*schema.Column{ProceduresColumns[0]}, OnDelete: schema.Cascade, }, }, } // ProgramRisksColumns holds the columns for the "program_risks" table. ProgramRisksColumns = []*schema.Column{ {Name: "program_id", Type: field.TypeString}, {Name: "risk_id", Type: field.TypeString}, } // ProgramRisksTable holds the schema information for the "program_risks" table. ProgramRisksTable = &schema.Table{ Name: "program_risks", Columns: ProgramRisksColumns, PrimaryKey: []*schema.Column{ProgramRisksColumns[0], ProgramRisksColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "program_risks_program_id", Columns: []*schema.Column{ProgramRisksColumns[0]}, RefColumns: []*schema.Column{ProgramsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "program_risks_risk_id", Columns: []*schema.Column{ProgramRisksColumns[1]}, RefColumns: []*schema.Column{RisksColumns[0]}, OnDelete: schema.Cascade, }, }, } // ProgramTasksColumns holds the columns for the "program_tasks" table. ProgramTasksColumns = []*schema.Column{ {Name: "program_id", Type: field.TypeString}, {Name: "task_id", Type: field.TypeString}, } // ProgramTasksTable holds the schema information for the "program_tasks" table. ProgramTasksTable = &schema.Table{ Name: "program_tasks", Columns: ProgramTasksColumns, PrimaryKey: []*schema.Column{ProgramTasksColumns[0], ProgramTasksColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "program_tasks_program_id", Columns: []*schema.Column{ProgramTasksColumns[0]}, RefColumns: []*schema.Column{ProgramsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "program_tasks_task_id", Columns: []*schema.Column{ProgramTasksColumns[1]}, RefColumns: []*schema.Column{TasksColumns[0]}, OnDelete: schema.Cascade, }, }, } // ProgramNotesColumns holds the columns for the "program_notes" table. ProgramNotesColumns = []*schema.Column{ {Name: "program_id", Type: field.TypeString}, {Name: "note_id", Type: field.TypeString}, } // ProgramNotesTable holds the schema information for the "program_notes" table. ProgramNotesTable = &schema.Table{ Name: "program_notes", Columns: ProgramNotesColumns, PrimaryKey: []*schema.Column{ProgramNotesColumns[0], ProgramNotesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "program_notes_program_id", Columns: []*schema.Column{ProgramNotesColumns[0]}, RefColumns: []*schema.Column{ProgramsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "program_notes_note_id", Columns: []*schema.Column{ProgramNotesColumns[1]}, RefColumns: []*schema.Column{NotesColumns[0]}, OnDelete: schema.Cascade, }, }, } // ProgramFilesColumns holds the columns for the "program_files" table. ProgramFilesColumns = []*schema.Column{ {Name: "program_id", Type: field.TypeString}, {Name: "file_id", Type: field.TypeString}, } // ProgramFilesTable holds the schema information for the "program_files" table. ProgramFilesTable = &schema.Table{ Name: "program_files", Columns: ProgramFilesColumns, PrimaryKey: []*schema.Column{ProgramFilesColumns[0], ProgramFilesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "program_files_program_id", Columns: []*schema.Column{ProgramFilesColumns[0]}, RefColumns: []*schema.Column{ProgramsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "program_files_file_id", Columns: []*schema.Column{ProgramFilesColumns[1]}, RefColumns: []*schema.Column{FilesColumns[0]}, OnDelete: schema.Cascade, }, }, } // ProgramNarrativesColumns holds the columns for the "program_narratives" table. ProgramNarrativesColumns = []*schema.Column{ {Name: "program_id", Type: field.TypeString}, {Name: "narrative_id", Type: field.TypeString}, } // ProgramNarrativesTable holds the schema information for the "program_narratives" table. ProgramNarrativesTable = &schema.Table{ Name: "program_narratives", Columns: ProgramNarrativesColumns, PrimaryKey: []*schema.Column{ProgramNarrativesColumns[0], ProgramNarrativesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "program_narratives_program_id", Columns: []*schema.Column{ProgramNarrativesColumns[0]}, RefColumns: []*schema.Column{ProgramsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "program_narratives_narrative_id", Columns: []*schema.Column{ProgramNarrativesColumns[1]}, RefColumns: []*schema.Column{NarrativesColumns[0]}, OnDelete: schema.Cascade, }, }, } // ProgramActionPlansColumns holds the columns for the "program_action_plans" table. ProgramActionPlansColumns = []*schema.Column{ {Name: "program_id", Type: field.TypeString}, {Name: "action_plan_id", Type: field.TypeString}, } // ProgramActionPlansTable holds the schema information for the "program_action_plans" table. ProgramActionPlansTable = &schema.Table{ Name: "program_action_plans", Columns: ProgramActionPlansColumns, PrimaryKey: []*schema.Column{ProgramActionPlansColumns[0], ProgramActionPlansColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "program_action_plans_program_id", Columns: []*schema.Column{ProgramActionPlansColumns[0]}, RefColumns: []*schema.Column{ProgramsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "program_action_plans_action_plan_id", Columns: []*schema.Column{ProgramActionPlansColumns[1]}, RefColumns: []*schema.Column{ActionPlansColumns[0]}, OnDelete: schema.Cascade, }, }, } // RiskBlockedGroupsColumns holds the columns for the "risk_blocked_groups" table. RiskBlockedGroupsColumns = []*schema.Column{ {Name: "risk_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // RiskBlockedGroupsTable holds the schema information for the "risk_blocked_groups" table. RiskBlockedGroupsTable = &schema.Table{ Name: "risk_blocked_groups", Columns: RiskBlockedGroupsColumns, PrimaryKey: []*schema.Column{RiskBlockedGroupsColumns[0], RiskBlockedGroupsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "risk_blocked_groups_risk_id", Columns: []*schema.Column{RiskBlockedGroupsColumns[0]}, RefColumns: []*schema.Column{RisksColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "risk_blocked_groups_group_id", Columns: []*schema.Column{RiskBlockedGroupsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // RiskEditorsColumns holds the columns for the "risk_editors" table. RiskEditorsColumns = []*schema.Column{ {Name: "risk_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // RiskEditorsTable holds the schema information for the "risk_editors" table. RiskEditorsTable = &schema.Table{ Name: "risk_editors", Columns: RiskEditorsColumns, PrimaryKey: []*schema.Column{RiskEditorsColumns[0], RiskEditorsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "risk_editors_risk_id", Columns: []*schema.Column{RiskEditorsColumns[0]}, RefColumns: []*schema.Column{RisksColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "risk_editors_group_id", Columns: []*schema.Column{RiskEditorsColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // RiskViewersColumns holds the columns for the "risk_viewers" table. RiskViewersColumns = []*schema.Column{ {Name: "risk_id", Type: field.TypeString}, {Name: "group_id", Type: field.TypeString}, } // RiskViewersTable holds the schema information for the "risk_viewers" table. RiskViewersTable = &schema.Table{ Name: "risk_viewers", Columns: RiskViewersColumns, PrimaryKey: []*schema.Column{RiskViewersColumns[0], RiskViewersColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "risk_viewers_risk_id", Columns: []*schema.Column{RiskViewersColumns[0]}, RefColumns: []*schema.Column{RisksColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "risk_viewers_group_id", Columns: []*schema.Column{RiskViewersColumns[1]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.Cascade, }, }, } // RiskActionPlansColumns holds the columns for the "risk_action_plans" table. RiskActionPlansColumns = []*schema.Column{ {Name: "risk_id", Type: field.TypeString}, {Name: "action_plan_id", Type: field.TypeString}, } // RiskActionPlansTable holds the schema information for the "risk_action_plans" table. RiskActionPlansTable = &schema.Table{ Name: "risk_action_plans", Columns: RiskActionPlansColumns, PrimaryKey: []*schema.Column{RiskActionPlansColumns[0], RiskActionPlansColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "risk_action_plans_risk_id", Columns: []*schema.Column{RiskActionPlansColumns[0]}, RefColumns: []*schema.Column{RisksColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "risk_action_plans_action_plan_id", Columns: []*schema.Column{RiskActionPlansColumns[1]}, RefColumns: []*schema.Column{ActionPlansColumns[0]}, OnDelete: schema.Cascade, }, }, } // StandardControlObjectivesColumns holds the columns for the "standard_control_objectives" table. StandardControlObjectivesColumns = []*schema.Column{ {Name: "standard_id", Type: field.TypeString}, {Name: "control_objective_id", Type: field.TypeString}, } // StandardControlObjectivesTable holds the schema information for the "standard_control_objectives" table. StandardControlObjectivesTable = &schema.Table{ Name: "standard_control_objectives", Columns: StandardControlObjectivesColumns, PrimaryKey: []*schema.Column{StandardControlObjectivesColumns[0], StandardControlObjectivesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "standard_control_objectives_standard_id", Columns: []*schema.Column{StandardControlObjectivesColumns[0]}, RefColumns: []*schema.Column{StandardsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "standard_control_objectives_control_objective_id", Columns: []*schema.Column{StandardControlObjectivesColumns[1]}, RefColumns: []*schema.Column{ControlObjectivesColumns[0]}, OnDelete: schema.Cascade, }, }, } // StandardControlsColumns holds the columns for the "standard_controls" table. StandardControlsColumns = []*schema.Column{ {Name: "standard_id", Type: field.TypeString}, {Name: "control_id", Type: field.TypeString}, } // StandardControlsTable holds the schema information for the "standard_controls" table. StandardControlsTable = &schema.Table{ Name: "standard_controls", Columns: StandardControlsColumns, PrimaryKey: []*schema.Column{StandardControlsColumns[0], StandardControlsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "standard_controls_standard_id", Columns: []*schema.Column{StandardControlsColumns[0]}, RefColumns: []*schema.Column{StandardsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "standard_controls_control_id", Columns: []*schema.Column{StandardControlsColumns[1]}, RefColumns: []*schema.Column{ControlsColumns[0]}, OnDelete: schema.Cascade, }, }, } // StandardActionPlansColumns holds the columns for the "standard_action_plans" table. StandardActionPlansColumns = []*schema.Column{ {Name: "standard_id", Type: field.TypeString}, {Name: "action_plan_id", Type: field.TypeString}, } // StandardActionPlansTable holds the schema information for the "standard_action_plans" table. StandardActionPlansTable = &schema.Table{ Name: "standard_action_plans", Columns: StandardActionPlansColumns, PrimaryKey: []*schema.Column{StandardActionPlansColumns[0], StandardActionPlansColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "standard_action_plans_standard_id", Columns: []*schema.Column{StandardActionPlansColumns[0]}, RefColumns: []*schema.Column{StandardsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "standard_action_plans_action_plan_id", Columns: []*schema.Column{StandardActionPlansColumns[1]}, RefColumns: []*schema.Column{ActionPlansColumns[0]}, OnDelete: schema.Cascade, }, }, } // StandardProgramsColumns holds the columns for the "standard_programs" table. StandardProgramsColumns = []*schema.Column{ {Name: "standard_id", Type: field.TypeString}, {Name: "program_id", Type: field.TypeString}, } // StandardProgramsTable holds the schema information for the "standard_programs" table. StandardProgramsTable = &schema.Table{ Name: "standard_programs", Columns: StandardProgramsColumns, PrimaryKey: []*schema.Column{StandardProgramsColumns[0], StandardProgramsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "standard_programs_standard_id", Columns: []*schema.Column{StandardProgramsColumns[0]}, RefColumns: []*schema.Column{StandardsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "standard_programs_program_id", Columns: []*schema.Column{StandardProgramsColumns[1]}, RefColumns: []*schema.Column{ProgramsColumns[0]}, OnDelete: schema.Cascade, }, }, } // SubcontrolTasksColumns holds the columns for the "subcontrol_tasks" table. SubcontrolTasksColumns = []*schema.Column{ {Name: "subcontrol_id", Type: field.TypeString}, {Name: "task_id", Type: field.TypeString}, } // SubcontrolTasksTable holds the schema information for the "subcontrol_tasks" table. SubcontrolTasksTable = &schema.Table{ Name: "subcontrol_tasks", Columns: SubcontrolTasksColumns, PrimaryKey: []*schema.Column{SubcontrolTasksColumns[0], SubcontrolTasksColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "subcontrol_tasks_subcontrol_id", Columns: []*schema.Column{SubcontrolTasksColumns[0]}, RefColumns: []*schema.Column{SubcontrolsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "subcontrol_tasks_task_id", Columns: []*schema.Column{SubcontrolTasksColumns[1]}, RefColumns: []*schema.Column{TasksColumns[0]}, OnDelete: schema.Cascade, }, }, } // SubscriberEventsColumns holds the columns for the "subscriber_events" table. SubscriberEventsColumns = []*schema.Column{ {Name: "subscriber_id", Type: field.TypeString}, {Name: "event_id", Type: field.TypeString}, } // SubscriberEventsTable holds the schema information for the "subscriber_events" table. SubscriberEventsTable = &schema.Table{ Name: "subscriber_events", Columns: SubscriberEventsColumns, PrimaryKey: []*schema.Column{SubscriberEventsColumns[0], SubscriberEventsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "subscriber_events_subscriber_id", Columns: []*schema.Column{SubscriberEventsColumns[0]}, RefColumns: []*schema.Column{SubscribersColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "subscriber_events_event_id", Columns: []*schema.Column{SubscriberEventsColumns[1]}, RefColumns: []*schema.Column{EventsColumns[0]}, OnDelete: schema.Cascade, }, }, } // TemplateFilesColumns holds the columns for the "template_files" table. TemplateFilesColumns = []*schema.Column{ {Name: "template_id", Type: field.TypeString}, {Name: "file_id", Type: field.TypeString}, } // TemplateFilesTable holds the schema information for the "template_files" table. TemplateFilesTable = &schema.Table{ Name: "template_files", Columns: TemplateFilesColumns, PrimaryKey: []*schema.Column{TemplateFilesColumns[0], TemplateFilesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "template_files_template_id", Columns: []*schema.Column{TemplateFilesColumns[0]}, RefColumns: []*schema.Column{TemplatesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "template_files_file_id", Columns: []*schema.Column{TemplateFilesColumns[1]}, RefColumns: []*schema.Column{FilesColumns[0]}, OnDelete: schema.Cascade, }, }, } // UserFilesColumns holds the columns for the "user_files" table. UserFilesColumns = []*schema.Column{ {Name: "user_id", Type: field.TypeString}, {Name: "file_id", Type: field.TypeString}, } // UserFilesTable holds the schema information for the "user_files" table. UserFilesTable = &schema.Table{ Name: "user_files", Columns: UserFilesColumns, PrimaryKey: []*schema.Column{UserFilesColumns[0], UserFilesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "user_files_user_id", Columns: []*schema.Column{UserFilesColumns[0]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "user_files_file_id", Columns: []*schema.Column{UserFilesColumns[1]}, RefColumns: []*schema.Column{FilesColumns[0]}, OnDelete: schema.Cascade, }, }, } // UserEventsColumns holds the columns for the "user_events" table. UserEventsColumns = []*schema.Column{ {Name: "user_id", Type: field.TypeString}, {Name: "event_id", Type: field.TypeString}, } // UserEventsTable holds the schema information for the "user_events" table. UserEventsTable = &schema.Table{ Name: "user_events", Columns: UserEventsColumns, PrimaryKey: []*schema.Column{UserEventsColumns[0], UserEventsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "user_events_user_id", Columns: []*schema.Column{UserEventsColumns[0]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "user_events_event_id", Columns: []*schema.Column{UserEventsColumns[1]}, RefColumns: []*schema.Column{EventsColumns[0]}, OnDelete: schema.Cascade, }, }, } // UserActionPlansColumns holds the columns for the "user_action_plans" table. UserActionPlansColumns = []*schema.Column{ {Name: "user_id", Type: field.TypeString}, {Name: "action_plan_id", Type: field.TypeString}, } // UserActionPlansTable holds the schema information for the "user_action_plans" table. UserActionPlansTable = &schema.Table{ Name: "user_action_plans", Columns: UserActionPlansColumns, PrimaryKey: []*schema.Column{UserActionPlansColumns[0], UserActionPlansColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "user_action_plans_user_id", Columns: []*schema.Column{UserActionPlansColumns[0]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "user_action_plans_action_plan_id", Columns: []*schema.Column{UserActionPlansColumns[1]}, RefColumns: []*schema.Column{ActionPlansColumns[0]}, OnDelete: schema.Cascade, }, }, } // UserSubcontrolsColumns holds the columns for the "user_subcontrols" table. UserSubcontrolsColumns = []*schema.Column{ {Name: "user_id", Type: field.TypeString}, {Name: "subcontrol_id", Type: field.TypeString}, } // UserSubcontrolsTable holds the schema information for the "user_subcontrols" table. UserSubcontrolsTable = &schema.Table{ Name: "user_subcontrols", Columns: UserSubcontrolsColumns, PrimaryKey: []*schema.Column{UserSubcontrolsColumns[0], UserSubcontrolsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "user_subcontrols_user_id", Columns: []*schema.Column{UserSubcontrolsColumns[0]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "user_subcontrols_subcontrol_id", Columns: []*schema.Column{UserSubcontrolsColumns[1]}, RefColumns: []*schema.Column{SubcontrolsColumns[0]}, OnDelete: schema.Cascade, }, }, } // UserSettingFilesColumns holds the columns for the "user_setting_files" table. UserSettingFilesColumns = []*schema.Column{ {Name: "user_setting_id", Type: field.TypeString}, {Name: "file_id", Type: field.TypeString}, } // UserSettingFilesTable holds the schema information for the "user_setting_files" table. UserSettingFilesTable = &schema.Table{ Name: "user_setting_files", Columns: UserSettingFilesColumns, PrimaryKey: []*schema.Column{UserSettingFilesColumns[0], UserSettingFilesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "user_setting_files_user_setting_id", Columns: []*schema.Column{UserSettingFilesColumns[0]}, RefColumns: []*schema.Column{UserSettingsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "user_setting_files_file_id", Columns: []*schema.Column{UserSettingFilesColumns[1]}, RefColumns: []*schema.Column{FilesColumns[0]}, OnDelete: schema.Cascade, }, }, } // Tables holds all the tables in the schema. Tables = []*schema.Table{}/* 159 elements not displayed */ )
Functions ¶
func Create ¶
func Create(ctx context.Context, s *Schema, tables []*schema.Table, opts ...schema.MigrateOption) error
Create creates all table resources using the given schema driver.
Types ¶
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
Schema is the API for creating, migrating and dropping a schema.
func (*Schema) Diff ¶
Diff creates a migration file containing the statements to resolve the diff between the Ent schema and the connected database.
func (*Schema) NamedDiff ¶
NamedDiff creates a named migration file containing the statements to resolve the diff between the Ent schema and the connected database.
Click to show internal directories.
Click to hide internal directories.