Documentation
¶
Index ¶
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 ( // SfAccessChangesColumns holds the columns for the "sf_access_changes" table. SfAccessChangesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "principal_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID, Nullable: true}, {Name: "changed_at", Type: field.TypeTime}, {Name: "reason", Type: field.TypeString, Size: 64}, } // SfAccessChangesTable holds the schema information for the "sf_access_changes" table. SfAccessChangesTable = &schema.Table{ Name: "sf_access_changes", Columns: SfAccessChangesColumns, PrimaryKey: []*schema.Column{SfAccessChangesColumns[0]}, Indexes: []*schema.Index{ { Name: "accesschange_changed_at", Unique: false, Columns: []*schema.Column{SfAccessChangesColumns[3]}, }, }, } // SfAgentsColumns holds the columns for the "sf_agents" table. SfAgentsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "model_id", Type: field.TypeString}, {Name: "version", Type: field.TypeString, Nullable: true}, {Name: "capability_constraints", Type: field.TypeJSON}, {Name: "resource_constraints", Type: field.TypeJSON}, {Name: "action_constraints", Type: field.TypeJSON}, {Name: "scope_constraints", Type: field.TypeJSON}, {Name: "delegation_expires_at", Type: field.TypeTime, Nullable: true}, {Name: "max_token_lifetime", Type: field.TypeInt, Default: 3600}, {Name: "session_id", Type: field.TypeString, Nullable: true}, {Name: "requires_confirmation", Type: field.TypeBool, Default: true}, {Name: "delegating_principal_id", Type: field.TypeUUID, Nullable: true}, {Name: "principal_id", Type: field.TypeUUID, Unique: true}, } // SfAgentsTable holds the schema information for the "sf_agents" table. SfAgentsTable = &schema.Table{ Name: "sf_agents", Columns: SfAgentsColumns, PrimaryKey: []*schema.Column{SfAgentsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_agents_sf_principals_delegating_principal", Columns: []*schema.Column{SfAgentsColumns[13]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "sf_agents_sf_principals_agent", Columns: []*schema.Column{SfAgentsColumns[14]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "agent_principal_id", Unique: true, Columns: []*schema.Column{SfAgentsColumns[14]}, }, { Name: "agent_model_id", Unique: false, Columns: []*schema.Column{SfAgentsColumns[3]}, }, { Name: "agent_delegating_principal_id", Unique: false, Columns: []*schema.Column{SfAgentsColumns[13]}, }, { Name: "agent_session_id", Unique: false, Columns: []*schema.Column{SfAgentsColumns[11]}, }, { Name: "agent_requires_confirmation", Unique: false, Columns: []*schema.Column{SfAgentsColumns[12]}, }, }, } // SfAppRolesColumns holds the columns for the "sf_app_roles" table. SfAppRolesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "application", Type: field.TypeString}, {Name: "role", Type: field.TypeString}, {Name: "principal_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, {Name: "assigned_by", Type: field.TypeUUID, Nullable: true}, } // SfAppRolesTable holds the schema information for the "sf_app_roles" table. SfAppRolesTable = &schema.Table{ Name: "sf_app_roles", Columns: SfAppRolesColumns, PrimaryKey: []*schema.Column{SfAppRolesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_app_roles_sf_principals_principal", Columns: []*schema.Column{SfAppRolesColumns[5]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "sf_app_roles_sf_organizations_organization", Columns: []*schema.Column{SfAppRolesColumns[6]}, RefColumns: []*schema.Column{SfOrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "sf_app_roles_sf_principals_assigner", Columns: []*schema.Column{SfAppRolesColumns[7]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "approle_principal_id_organization_id_application", Unique: true, Columns: []*schema.Column{SfAppRolesColumns[5], SfAppRolesColumns[6], SfAppRolesColumns[3]}, }, { Name: "approle_organization_id_application", Unique: false, Columns: []*schema.Column{SfAppRolesColumns[6], SfAppRolesColumns[3]}, }, }, } // SfApplicationsColumns holds the columns for the "sf_applications" table. SfApplicationsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "client_id", Type: field.TypeString, Unique: true}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 1000}, {Name: "logo_url", Type: field.TypeString, Nullable: true}, {Name: "app_type", Type: field.TypeEnum, Enums: []string{"web", "spa", "native", "machine"}, Default: "web"}, {Name: "redirect_uris", Type: field.TypeJSON}, {Name: "allowed_grants", Type: field.TypeJSON}, {Name: "allowed_response_types", Type: field.TypeJSON}, {Name: "access_token_ttl", Type: field.TypeInt, Default: 900}, {Name: "refresh_token_ttl", Type: field.TypeInt, Default: 604800}, {Name: "refresh_token_rotation", Type: field.TypeBool, Default: true}, {Name: "first_party", Type: field.TypeBool, Default: false}, {Name: "public", Type: field.TypeBool, Default: false}, {Name: "principal_id", Type: field.TypeUUID, Unique: true}, } // SfApplicationsTable holds the schema information for the "sf_applications" table. SfApplicationsTable = &schema.Table{ Name: "sf_applications", Columns: SfApplicationsColumns, PrimaryKey: []*schema.Column{SfApplicationsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_applications_sf_principals_application", Columns: []*schema.Column{SfApplicationsColumns[15]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "application_principal_id", Unique: true, Columns: []*schema.Column{SfApplicationsColumns[15]}, }, { Name: "application_client_id", Unique: true, Columns: []*schema.Column{SfApplicationsColumns[3]}, }, { Name: "application_app_type", Unique: false, Columns: []*schema.Column{SfApplicationsColumns[6]}, }, { Name: "application_first_party", Unique: false, Columns: []*schema.Column{SfApplicationsColumns[13]}, }, }, } // SfClientAssertionJtisColumns holds the columns for the "sf_client_assertion_jtis" table. SfClientAssertionJtisColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "jti", Type: field.TypeString, Unique: true}, {Name: "expires_at", Type: field.TypeTime}, } // SfClientAssertionJtisTable holds the schema information for the "sf_client_assertion_jtis" table. SfClientAssertionJtisTable = &schema.Table{ Name: "sf_client_assertion_jtis", Columns: SfClientAssertionJtisColumns, PrimaryKey: []*schema.Column{SfClientAssertionJtisColumns[0]}, Indexes: []*schema.Index{ { Name: "clientassertionjti_expires_at", Unique: false, Columns: []*schema.Column{SfClientAssertionJtisColumns[4]}, }, }, } // SfConsentGrantsColumns holds the columns for the "sf_consent_grants" table. SfConsentGrantsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "principal_id", Type: field.TypeString}, {Name: "client_id", Type: field.TypeString}, {Name: "scope", Type: field.TypeString}, {Name: "granted_at", Type: field.TypeTime}, } // SfConsentGrantsTable holds the schema information for the "sf_consent_grants" table. SfConsentGrantsTable = &schema.Table{ Name: "sf_consent_grants", Columns: SfConsentGrantsColumns, PrimaryKey: []*schema.Column{SfConsentGrantsColumns[0]}, Indexes: []*schema.Index{ { Name: "consentgrant_principal_id_client_id_scope", Unique: true, Columns: []*schema.Column{SfConsentGrantsColumns[1], SfConsentGrantsColumns[2], SfConsentGrantsColumns[3]}, }, { Name: "consentgrant_client_id", Unique: false, Columns: []*schema.Column{SfConsentGrantsColumns[2]}, }, }, } // SfCredentialsColumns holds the columns for the "sf_credentials" table. SfCredentialsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "type", Type: field.TypeEnum, Enums: []string{"password", "api_key", "keypair", "webauthn", "totp", "client_secret", "login_token"}}, {Name: "identifier", Type: field.TypeString, Nullable: true}, {Name: "secret_hash", Type: field.TypeString, Nullable: true}, {Name: "public_key", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "key_algorithm", Type: field.TypeString, Nullable: true}, {Name: "key_id", Type: field.TypeString, Unique: true, Nullable: true}, {Name: "webauthn_credential_id", Type: field.TypeBytes, Nullable: true}, {Name: "webauthn_public_key", Type: field.TypeBytes, Nullable: true}, {Name: "webauthn_aaguid", Type: field.TypeString, Nullable: true}, {Name: "webauthn_sign_count", Type: field.TypeUint32, Nullable: true, Default: 0}, {Name: "scopes", Type: field.TypeJSON}, {Name: "active", Type: field.TypeBool, Default: true}, {Name: "expires_at", Type: field.TypeTime, Nullable: true}, {Name: "revoked", Type: field.TypeBool, Default: false}, {Name: "revoked_at", Type: field.TypeTime, Nullable: true}, {Name: "revoked_reason", Type: field.TypeString, Nullable: true}, {Name: "last_used_at", Type: field.TypeTime, Nullable: true}, {Name: "last_used_ip", Type: field.TypeString, Nullable: true}, {Name: "name", Type: field.TypeString, Nullable: true}, {Name: "metadata", Type: field.TypeJSON, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "principal_id", Type: field.TypeUUID}, } // SfCredentialsTable holds the schema information for the "sf_credentials" table. SfCredentialsTable = &schema.Table{ Name: "sf_credentials", Columns: SfCredentialsColumns, PrimaryKey: []*schema.Column{SfCredentialsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_credentials_sf_principals_credentials", Columns: []*schema.Column{SfCredentialsColumns[23]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "credential_principal_id", Unique: false, Columns: []*schema.Column{SfCredentialsColumns[23]}, }, { Name: "credential_principal_id_type", Unique: false, Columns: []*schema.Column{SfCredentialsColumns[23], SfCredentialsColumns[1]}, }, { Name: "credential_type", Unique: false, Columns: []*schema.Column{SfCredentialsColumns[1]}, }, { Name: "credential_identifier", Unique: false, Columns: []*schema.Column{SfCredentialsColumns[2]}, }, { Name: "credential_active", Unique: false, Columns: []*schema.Column{SfCredentialsColumns[12]}, }, { Name: "credential_revoked", Unique: false, Columns: []*schema.Column{SfCredentialsColumns[14]}, }, { Name: "credential_expires_at", Unique: false, Columns: []*schema.Column{SfCredentialsColumns[13]}, }, { Name: "credential_type_identifier", Unique: true, Columns: []*schema.Column{SfCredentialsColumns[1], SfCredentialsColumns[2]}, }, }, } // SfExternalIdentitiesColumns holds the columns for the "sf_external_identities" table. SfExternalIdentitiesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "provider", Type: field.TypeString}, {Name: "subject", Type: field.TypeString}, {Name: "email", Type: field.TypeString, Nullable: true}, {Name: "email_verified", Type: field.TypeBool, Default: false}, {Name: "last_login_at", Type: field.TypeTime, Nullable: true}, {Name: "principal_id", Type: field.TypeUUID}, } // SfExternalIdentitiesTable holds the schema information for the "sf_external_identities" table. SfExternalIdentitiesTable = &schema.Table{ Name: "sf_external_identities", Columns: SfExternalIdentitiesColumns, PrimaryKey: []*schema.Column{SfExternalIdentitiesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_external_identities_sf_principals_external_identities", Columns: []*schema.Column{SfExternalIdentitiesColumns[8]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "externalidentity_provider_subject", Unique: true, Columns: []*schema.Column{SfExternalIdentitiesColumns[3], SfExternalIdentitiesColumns[4]}, }, { Name: "externalidentity_principal_id", Unique: false, Columns: []*schema.Column{SfExternalIdentitiesColumns[8]}, }, }, } // SfHumansColumns holds the columns for the "sf_humans" table. SfHumansColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "email", Type: field.TypeString, Unique: true, Nullable: true}, {Name: "given_name", Type: field.TypeString, Nullable: true}, {Name: "family_name", Type: field.TypeString, Nullable: true}, {Name: "avatar_url", Type: field.TypeString, Nullable: true}, {Name: "locale", Type: field.TypeString, Nullable: true, Default: "en"}, {Name: "timezone", Type: field.TypeString, Nullable: true, Default: "UTC"}, {Name: "is_platform_admin", Type: field.TypeBool, Default: false}, {Name: "last_login_at", Type: field.TypeTime, Nullable: true}, {Name: "email_verified_at", Type: field.TypeTime, Nullable: true}, {Name: "principal_id", Type: field.TypeUUID, Unique: true}, } // SfHumansTable holds the schema information for the "sf_humans" table. SfHumansTable = &schema.Table{ Name: "sf_humans", Columns: SfHumansColumns, PrimaryKey: []*schema.Column{SfHumansColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_humans_sf_principals_human", Columns: []*schema.Column{SfHumansColumns[12]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "human_principal_id", Unique: true, Columns: []*schema.Column{SfHumansColumns[12]}, }, { Name: "human_email", Unique: true, Columns: []*schema.Column{SfHumansColumns[3]}, }, { Name: "human_is_platform_admin", Unique: false, Columns: []*schema.Column{SfHumansColumns[9]}, }, }, } // SfInvitesColumns holds the columns for the "sf_invites" table. SfInvitesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "email", Type: field.TypeString}, {Name: "role", Type: field.TypeString, Default: "member"}, {Name: "app_roles", Type: field.TypeJSON, Nullable: true}, {Name: "resource_type", Type: field.TypeString, Nullable: true, Size: 128}, {Name: "resource_id", Type: field.TypeString, Nullable: true, Size: 1024}, {Name: "resource_role", Type: field.TypeString, Nullable: true}, {Name: "token", Type: field.TypeString, Unique: true}, {Name: "status", Type: field.TypeEnum, Enums: []string{"pending", "accepted", "declined", "expired", "revoked"}, Default: "pending"}, {Name: "message", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "expires_at", Type: field.TypeTime}, {Name: "accepted_at", Type: field.TypeTime, Nullable: true}, {Name: "accepted_by_principal_id", Type: field.TypeUUID, Nullable: true}, {Name: "resend_count", Type: field.TypeInt, Default: 0}, {Name: "last_sent_at", Type: field.TypeTime}, {Name: "organization_id", Type: field.TypeUUID}, {Name: "inviter_principal_id", Type: field.TypeUUID}, } // SfInvitesTable holds the schema information for the "sf_invites" table. SfInvitesTable = &schema.Table{ Name: "sf_invites", Columns: SfInvitesColumns, PrimaryKey: []*schema.Column{SfInvitesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_invites_sf_organizations_invites", Columns: []*schema.Column{SfInvitesColumns[17]}, RefColumns: []*schema.Column{SfOrganizationsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "sf_invites_sf_principals_sent_invites", Columns: []*schema.Column{SfInvitesColumns[18]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "invite_token", Unique: true, Columns: []*schema.Column{SfInvitesColumns[9]}, }, { Name: "invite_email", Unique: false, Columns: []*schema.Column{SfInvitesColumns[3]}, }, { Name: "invite_organization_id", Unique: false, Columns: []*schema.Column{SfInvitesColumns[17]}, }, { Name: "invite_organization_id_status", Unique: false, Columns: []*schema.Column{SfInvitesColumns[17], SfInvitesColumns[10]}, }, { Name: "invite_organization_id_email_status", Unique: false, Columns: []*schema.Column{SfInvitesColumns[17], SfInvitesColumns[3], SfInvitesColumns[10]}, }, { Name: "invite_inviter_principal_id", Unique: false, Columns: []*schema.Column{SfInvitesColumns[18]}, }, { Name: "invite_status_expires_at", Unique: false, Columns: []*schema.Column{SfInvitesColumns[10], SfInvitesColumns[12]}, }, }, } // SfLicensesColumns holds the columns for the "sf_licenses" table. SfLicensesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "license_type", Type: field.TypeEnum, Enums: []string{"seat_based", "team", "unlimited"}, Default: "unlimited"}, {Name: "seats", Type: field.TypeInt, Nullable: true}, {Name: "used_seats", Type: field.TypeInt, Default: 0}, {Name: "valid_from", Type: field.TypeTime}, {Name: "valid_until", Type: field.TypeTime, Nullable: true}, {Name: "stripe_subscription_id", Type: field.TypeString, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "listing_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, {Name: "purchased_by", Type: field.TypeUUID}, } // SfLicensesTable holds the schema information for the "sf_licenses" table. SfLicensesTable = &schema.Table{ Name: "sf_licenses", Columns: SfLicensesColumns, PrimaryKey: []*schema.Column{SfLicensesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_licenses_sf_listings_licenses", Columns: []*schema.Column{SfLicensesColumns[9]}, RefColumns: []*schema.Column{SfListingsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "sf_licenses_sf_organizations_licenses", Columns: []*schema.Column{SfLicensesColumns[10]}, RefColumns: []*schema.Column{SfOrganizationsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "sf_licenses_sf_principals_purchased_licenses", Columns: []*schema.Column{SfLicensesColumns[11]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "license_listing_id", Unique: false, Columns: []*schema.Column{SfLicensesColumns[9]}, }, { Name: "license_organization_id", Unique: false, Columns: []*schema.Column{SfLicensesColumns[10]}, }, { Name: "license_purchased_by", Unique: false, Columns: []*schema.Column{SfLicensesColumns[11]}, }, { Name: "license_license_type", Unique: false, Columns: []*schema.Column{SfLicensesColumns[1]}, }, { Name: "license_valid_from_valid_until", Unique: false, Columns: []*schema.Column{SfLicensesColumns[4], SfLicensesColumns[5]}, }, { Name: "license_stripe_subscription_id", Unique: false, Columns: []*schema.Column{SfLicensesColumns[6]}, }, { Name: "license_listing_id_organization_id", Unique: true, Columns: []*schema.Column{SfLicensesColumns[9], SfLicensesColumns[10]}, }, }, } // SfListingsColumns holds the columns for the "sf_listings" table. SfListingsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "product_type", Type: field.TypeString}, {Name: "product_id", Type: field.TypeUUID, Nullable: true}, {Name: "application", Type: field.TypeString, Nullable: true}, {Name: "title", Type: field.TypeString, Size: 200}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "pricing_model", Type: field.TypeEnum, Enums: []string{"free", "one_time", "subscription", "per_seat"}, Default: "free"}, {Name: "price_cents", Type: field.TypeInt64, Default: 0}, {Name: "currency", Type: field.TypeString, Size: 3, Default: "USD"}, {Name: "status", Type: field.TypeEnum, Enums: []string{"draft", "pending_review", "published", "archived"}, Default: "draft"}, {Name: "metadata", Type: field.TypeJSON, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "published_at", Type: field.TypeTime, Nullable: true}, {Name: "creator_org_id", Type: field.TypeUUID}, {Name: "owner_id", Type: field.TypeUUID}, } // SfListingsTable holds the schema information for the "sf_listings" table. SfListingsTable = &schema.Table{ Name: "sf_listings", Columns: SfListingsColumns, PrimaryKey: []*schema.Column{SfListingsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_listings_sf_organizations_listings", Columns: []*schema.Column{SfListingsColumns[14]}, RefColumns: []*schema.Column{SfOrganizationsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "sf_listings_sf_principals_owned_listings", Columns: []*schema.Column{SfListingsColumns[15]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "listing_creator_org_id", Unique: false, Columns: []*schema.Column{SfListingsColumns[14]}, }, { Name: "listing_owner_id", Unique: false, Columns: []*schema.Column{SfListingsColumns[15]}, }, { Name: "listing_status", Unique: false, Columns: []*schema.Column{SfListingsColumns[9]}, }, { Name: "listing_pricing_model", Unique: false, Columns: []*schema.Column{SfListingsColumns[6]}, }, { Name: "listing_product_type", Unique: false, Columns: []*schema.Column{SfListingsColumns[1]}, }, { Name: "listing_product_type_product_id", Unique: false, Columns: []*schema.Column{SfListingsColumns[1], SfListingsColumns[2]}, }, { Name: "listing_application", Unique: false, Columns: []*schema.Column{SfListingsColumns[3]}, }, { Name: "listing_status_created_at", Unique: false, Columns: []*schema.Column{SfListingsColumns[9], SfListingsColumns[11]}, }, }, } // SfLoginSessionsColumns holds the columns for the "sf_login_sessions" table. SfLoginSessionsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "token_hash", Type: field.TypeString, Unique: true}, {Name: "principal_id", Type: field.TypeUUID}, {Name: "provider", Type: field.TypeString, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "expires_at", Type: field.TypeTime}, } // SfLoginSessionsTable holds the schema information for the "sf_login_sessions" table. SfLoginSessionsTable = &schema.Table{ Name: "sf_login_sessions", Columns: SfLoginSessionsColumns, PrimaryKey: []*schema.Column{SfLoginSessionsColumns[0]}, Indexes: []*schema.Index{ { Name: "loginsession_principal_id", Unique: false, Columns: []*schema.Column{SfLoginSessionsColumns[2]}, }, { Name: "loginsession_expires_at", Unique: false, Columns: []*schema.Column{SfLoginSessionsColumns[5]}, }, }, } // SfLoginStatesColumns holds the columns for the "sf_login_states" table. SfLoginStatesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "state_hash", Type: field.TypeString, Unique: true}, {Name: "provider", Type: field.TypeString}, {Name: "redirect_url", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "nonce", Type: field.TypeString, Nullable: true}, {Name: "pkce_verifier", Type: field.TypeString, Nullable: true}, {Name: "expires_at", Type: field.TypeTime}, } // SfLoginStatesTable holds the schema information for the "sf_login_states" table. SfLoginStatesTable = &schema.Table{ Name: "sf_login_states", Columns: SfLoginStatesColumns, PrimaryKey: []*schema.Column{SfLoginStatesColumns[0]}, Indexes: []*schema.Index{ { Name: "loginstate_expires_at", Unique: false, Columns: []*schema.Column{SfLoginStatesColumns[6]}, }, }, } // SfManagerClaimsColumns holds the columns for the "sf_manager_claims" table. SfManagerClaimsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "code_prefix", Type: field.TypeString, Unique: true}, {Name: "code_hash", Type: field.TypeString}, {Name: "issued_by", Type: field.TypeUUID}, {Name: "expires_at", Type: field.TypeTime}, {Name: "redeemed_at", Type: field.TypeTime, Nullable: true}, {Name: "redeemed_by", Type: field.TypeUUID, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "managed_principal_id", Type: field.TypeUUID}, } // SfManagerClaimsTable holds the schema information for the "sf_manager_claims" table. SfManagerClaimsTable = &schema.Table{ Name: "sf_manager_claims", Columns: SfManagerClaimsColumns, PrimaryKey: []*schema.Column{SfManagerClaimsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_manager_claims_sf_principals_manager_claims", Columns: []*schema.Column{SfManagerClaimsColumns[8]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "managerclaim_managed_principal_id", Unique: false, Columns: []*schema.Column{SfManagerClaimsColumns[8]}, }, }, } // SfManagerInvitesColumns holds the columns for the "sf_manager_invites" table. SfManagerInvitesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "manager_principal_id", Type: field.TypeUUID}, {Name: "email", Type: field.TypeString}, {Name: "role", Type: field.TypeString}, {Name: "token_prefix", Type: field.TypeString, Unique: true}, {Name: "token_hash", Type: field.TypeString}, {Name: "expires_at", Type: field.TypeTime}, {Name: "accepted_at", Type: field.TypeTime, Nullable: true}, {Name: "accepted_by", Type: field.TypeUUID, Nullable: true}, {Name: "revoked_at", Type: field.TypeTime, Nullable: true}, {Name: "declined_at", Type: field.TypeTime, Nullable: true}, {Name: "declined_by", Type: field.TypeUUID, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, } // SfManagerInvitesTable holds the schema information for the "sf_manager_invites" table. SfManagerInvitesTable = &schema.Table{ Name: "sf_manager_invites", Columns: SfManagerInvitesColumns, PrimaryKey: []*schema.Column{SfManagerInvitesColumns[0]}, Indexes: []*schema.Index{ { Name: "managerinvite_manager_principal_id", Unique: false, Columns: []*schema.Column{SfManagerInvitesColumns[1]}, }, { Name: "managerinvite_email", Unique: false, Columns: []*schema.Column{SfManagerInvitesColumns[2]}, }, }, } // SfManagerRelationshipsColumns holds the columns for the "sf_manager_relationships" table. SfManagerRelationshipsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "role", Type: field.TypeString}, {Name: "active", Type: field.TypeBool, Default: true}, {Name: "created_by", Type: field.TypeUUID, Nullable: true}, {Name: "managed_principal_id", Type: field.TypeUUID}, {Name: "manager_principal_id", Type: field.TypeUUID}, } // SfManagerRelationshipsTable holds the schema information for the "sf_manager_relationships" table. SfManagerRelationshipsTable = &schema.Table{ Name: "sf_manager_relationships", Columns: SfManagerRelationshipsColumns, PrimaryKey: []*schema.Column{SfManagerRelationshipsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_manager_relationships_sf_principals_managers", Columns: []*schema.Column{SfManagerRelationshipsColumns[6]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "sf_manager_relationships_sf_principals_managing", Columns: []*schema.Column{SfManagerRelationshipsColumns[7]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "managerrelationship_managed_principal_id_manager_principal_id_role", Unique: true, Columns: []*schema.Column{SfManagerRelationshipsColumns[6], SfManagerRelationshipsColumns[7], SfManagerRelationshipsColumns[3]}, }, { Name: "managerrelationship_manager_principal_id", Unique: false, Columns: []*schema.Column{SfManagerRelationshipsColumns[7]}, }, }, } // SfOauthAppsColumns holds the columns for the "sf_oauth_apps" table. SfOauthAppsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "client_id", Type: field.TypeString, Unique: true}, {Name: "name", Type: field.TypeString, Size: 255}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 1000}, {Name: "logo_url", Type: field.TypeString, Nullable: true}, {Name: "app_type", Type: field.TypeEnum, Enums: []string{"web", "spa", "native", "service", "machine"}, Default: "web"}, {Name: "redirect_uris", Type: field.TypeJSON}, {Name: "allowed_scopes", Type: field.TypeJSON}, {Name: "allowed_grants", Type: field.TypeJSON}, {Name: "allowed_response_types", Type: field.TypeJSON}, {Name: "access_token_ttl", Type: field.TypeInt, Default: 600}, {Name: "refresh_token_ttl", Type: field.TypeInt, Default: 604800}, {Name: "login_token_ttl", Type: field.TypeInt, Nullable: true}, {Name: "backchannel_logout_uri", Type: field.TypeString, Nullable: true}, {Name: "refresh_token_rotation", Type: field.TypeBool, Default: true}, {Name: "managed_principals_enabled", Type: field.TypeBool, Default: false}, {Name: "first_party", Type: field.TypeBool, Default: false}, {Name: "public", Type: field.TypeBool, Default: false}, {Name: "active", Type: field.TypeBool, Default: true}, {Name: "revoked_at", Type: field.TypeTime, Nullable: true}, {Name: "metadata", Type: field.TypeJSON, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "organization_id", Type: field.TypeUUID, Nullable: true}, {Name: "owner_id", Type: field.TypeUUID}, } // SfOauthAppsTable holds the schema information for the "sf_oauth_apps" table. SfOauthAppsTable = &schema.Table{ Name: "sf_oauth_apps", Columns: SfOauthAppsColumns, PrimaryKey: []*schema.Column{SfOauthAppsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_oauth_apps_sf_organizations_oauth_apps", Columns: []*schema.Column{SfOauthAppsColumns[23]}, RefColumns: []*schema.Column{SfOrganizationsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "sf_oauth_apps_sf_principals_owned_oauth_apps", Columns: []*schema.Column{SfOauthAppsColumns[24]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "oauthapp_client_id", Unique: true, Columns: []*schema.Column{SfOauthAppsColumns[1]}, }, { Name: "oauthapp_owner_id", Unique: false, Columns: []*schema.Column{SfOauthAppsColumns[24]}, }, { Name: "oauthapp_organization_id", Unique: false, Columns: []*schema.Column{SfOauthAppsColumns[23]}, }, { Name: "oauthapp_active", Unique: false, Columns: []*schema.Column{SfOauthAppsColumns[18]}, }, }, } // SfOauthAppSecretsColumns holds the columns for the "sf_oauth_app_secrets" table. SfOauthAppSecretsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "secret_hash", Type: field.TypeString}, {Name: "secret_prefix", Type: field.TypeString, Size: 12}, {Name: "expires_at", Type: field.TypeTime, Nullable: true}, {Name: "last_used_at", Type: field.TypeTime, Nullable: true}, {Name: "revoked", Type: field.TypeBool, Default: false}, {Name: "revoked_at", Type: field.TypeTime, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "app_id", Type: field.TypeUUID}, } // SfOauthAppSecretsTable holds the schema information for the "sf_oauth_app_secrets" table. SfOauthAppSecretsTable = &schema.Table{ Name: "sf_oauth_app_secrets", Columns: SfOauthAppSecretsColumns, PrimaryKey: []*schema.Column{SfOauthAppSecretsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_oauth_app_secrets_sf_oauth_apps_secrets", Columns: []*schema.Column{SfOauthAppSecretsColumns[8]}, RefColumns: []*schema.Column{SfOauthAppsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "oauthappsecret_app_id", Unique: false, Columns: []*schema.Column{SfOauthAppSecretsColumns[8]}, }, { Name: "oauthappsecret_app_id_revoked", Unique: false, Columns: []*schema.Column{SfOauthAppSecretsColumns[8], SfOauthAppSecretsColumns[5]}, }, }, } // SfOauthAuthCodesColumns holds the columns for the "sf_oauth_auth_codes" table. SfOauthAuthCodesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "code_signature", Type: field.TypeString, Unique: true}, {Name: "subject", Type: field.TypeString, Nullable: true}, {Name: "code_challenge", Type: field.TypeString, Nullable: true}, {Name: "code_challenge_method", Type: field.TypeString, Nullable: true, Default: "S256"}, {Name: "redirect_uri", Type: field.TypeString}, {Name: "scopes", Type: field.TypeJSON}, {Name: "state", Type: field.TypeString, Nullable: true}, {Name: "nonce", Type: field.TypeString, Nullable: true}, {Name: "request_data", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "expires_at", Type: field.TypeTime}, {Name: "used", Type: field.TypeBool, Default: false}, {Name: "used_at", Type: field.TypeTime, Nullable: true}, {Name: "client_ip", Type: field.TypeString, Nullable: true}, {Name: "user_agent", Type: field.TypeString, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "app_id", Type: field.TypeUUID}, } // SfOauthAuthCodesTable holds the schema information for the "sf_oauth_auth_codes" table. SfOauthAuthCodesTable = &schema.Table{ Name: "sf_oauth_auth_codes", Columns: SfOauthAuthCodesColumns, PrimaryKey: []*schema.Column{SfOauthAuthCodesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_oauth_auth_codes_sf_oauth_apps_auth_codes", Columns: []*schema.Column{SfOauthAuthCodesColumns[16]}, RefColumns: []*schema.Column{SfOauthAppsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "oauthauthcode_code_signature", Unique: true, Columns: []*schema.Column{SfOauthAuthCodesColumns[1]}, }, { Name: "oauthauthcode_app_id", Unique: false, Columns: []*schema.Column{SfOauthAuthCodesColumns[16]}, }, { Name: "oauthauthcode_subject", Unique: false, Columns: []*schema.Column{SfOauthAuthCodesColumns[2]}, }, { Name: "oauthauthcode_expires_at", Unique: false, Columns: []*schema.Column{SfOauthAuthCodesColumns[10]}, }, { Name: "oauthauthcode_used", Unique: false, Columns: []*schema.Column{SfOauthAuthCodesColumns[11]}, }, }, } // SfOauthConsentsColumns holds the columns for the "sf_oauth_consents" table. SfOauthConsentsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "scopes", Type: field.TypeJSON}, {Name: "granted", Type: field.TypeBool, Default: true}, {Name: "granted_at", Type: field.TypeTime}, {Name: "last_used_at", Type: field.TypeTime, Nullable: true}, {Name: "revoked", Type: field.TypeBool, Default: false}, {Name: "revoked_at", Type: field.TypeTime, Nullable: true}, {Name: "revoked_reason", Type: field.TypeString, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "app_id", Type: field.TypeUUID}, {Name: "principal_id", Type: field.TypeUUID}, } // SfOauthConsentsTable holds the schema information for the "sf_oauth_consents" table. SfOauthConsentsTable = &schema.Table{ Name: "sf_oauth_consents", Columns: SfOauthConsentsColumns, PrimaryKey: []*schema.Column{SfOauthConsentsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_oauth_consents_sf_oauth_apps_consents", Columns: []*schema.Column{SfOauthConsentsColumns[10]}, RefColumns: []*schema.Column{SfOauthAppsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "sf_oauth_consents_sf_principals_oauth_consents", Columns: []*schema.Column{SfOauthConsentsColumns[11]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "oauthconsent_principal_id_app_id", Unique: true, Columns: []*schema.Column{SfOauthConsentsColumns[11], SfOauthConsentsColumns[10]}, }, { Name: "oauthconsent_principal_id", Unique: false, Columns: []*schema.Column{SfOauthConsentsColumns[11]}, }, { Name: "oauthconsent_app_id", Unique: false, Columns: []*schema.Column{SfOauthConsentsColumns[10]}, }, { Name: "oauthconsent_granted", Unique: false, Columns: []*schema.Column{SfOauthConsentsColumns[2]}, }, { Name: "oauthconsent_revoked", Unique: false, Columns: []*schema.Column{SfOauthConsentsColumns[5]}, }, }, } // SfOauthTokensColumns holds the columns for the "sf_oauth_tokens" table. SfOauthTokensColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "subject", Type: field.TypeString, Nullable: true}, {Name: "access_token_signature", Type: field.TypeString, Unique: true}, {Name: "refresh_token_signature", Type: field.TypeString, Unique: true, Nullable: true}, {Name: "family_id", Type: field.TypeUUID}, {Name: "scopes", Type: field.TypeJSON}, {Name: "audience", Type: field.TypeJSON}, {Name: "session_id", Type: field.TypeString, Nullable: true}, {Name: "request_data", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "access_expires_at", Type: field.TypeTime}, {Name: "refresh_expires_at", Type: field.TypeTime, Nullable: true}, {Name: "revoked", Type: field.TypeBool, Default: false}, {Name: "revoked_at", Type: field.TypeTime, Nullable: true}, {Name: "revoked_reason", Type: field.TypeString, Nullable: true}, {Name: "client_ip", Type: field.TypeString, Nullable: true}, {Name: "user_agent", Type: field.TypeString, Nullable: true}, {Name: "last_used_at", Type: field.TypeTime, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "app_id", Type: field.TypeUUID}, } // SfOauthTokensTable holds the schema information for the "sf_oauth_tokens" table. SfOauthTokensTable = &schema.Table{ Name: "sf_oauth_tokens", Columns: SfOauthTokensColumns, PrimaryKey: []*schema.Column{SfOauthTokensColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_oauth_tokens_sf_oauth_apps_tokens", Columns: []*schema.Column{SfOauthTokensColumns[18]}, RefColumns: []*schema.Column{SfOauthAppsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "oauthtoken_access_token_signature", Unique: true, Columns: []*schema.Column{SfOauthTokensColumns[2]}, }, { Name: "oauthtoken_refresh_token_signature", Unique: true, Columns: []*schema.Column{SfOauthTokensColumns[3]}, }, { Name: "oauthtoken_app_id", Unique: false, Columns: []*schema.Column{SfOauthTokensColumns[18]}, }, { Name: "oauthtoken_subject", Unique: false, Columns: []*schema.Column{SfOauthTokensColumns[1]}, }, { Name: "oauthtoken_family_id", Unique: false, Columns: []*schema.Column{SfOauthTokensColumns[4]}, }, { Name: "oauthtoken_revoked", Unique: false, Columns: []*schema.Column{SfOauthTokensColumns[11]}, }, { Name: "oauthtoken_access_expires_at", Unique: false, Columns: []*schema.Column{SfOauthTokensColumns[9]}, }, }, } // SfOrganizationsColumns holds the columns for the "sf_organizations" table. SfOrganizationsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "name", Type: field.TypeString}, {Name: "slug", Type: field.TypeString, Unique: true}, {Name: "org_type", Type: field.TypeEnum, Enums: []string{"personal", "team", "enterprise"}, Default: "team"}, {Name: "logo_url", Type: field.TypeString, Nullable: true}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "website_url", Type: field.TypeString, Nullable: true}, {Name: "settings", Type: field.TypeJSON, Nullable: true}, {Name: "active", Type: field.TypeBool, Default: true}, {Name: "owner_principal_id", Type: field.TypeUUID, Nullable: true}, } // SfOrganizationsTable holds the schema information for the "sf_organizations" table. SfOrganizationsTable = &schema.Table{ Name: "sf_organizations", Columns: SfOrganizationsColumns, PrimaryKey: []*schema.Column{SfOrganizationsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_organizations_sf_principals_owned_organizations", Columns: []*schema.Column{SfOrganizationsColumns[11]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "organization_slug", Unique: true, Columns: []*schema.Column{SfOrganizationsColumns[4]}, }, { Name: "organization_active", Unique: false, Columns: []*schema.Column{SfOrganizationsColumns[10]}, }, { Name: "organization_org_type", Unique: false, Columns: []*schema.Column{SfOrganizationsColumns[5]}, }, { Name: "organization_owner_principal_id", Unique: false, Columns: []*schema.Column{SfOrganizationsColumns[11]}, }, { Name: "organization_org_type_active", Unique: false, Columns: []*schema.Column{SfOrganizationsColumns[5], SfOrganizationsColumns[10]}, }, }, } // SfPrincipalsColumns holds the columns for the "sf_principals" table. SfPrincipalsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "type", Type: field.TypeEnum, Enums: []string{"human", "application", "agent", "service"}}, {Name: "identifier", Type: field.TypeString, Unique: true}, {Name: "display_name", Type: field.TypeString}, {Name: "active", Type: field.TypeBool, Default: true}, {Name: "capabilities", Type: field.TypeJSON}, {Name: "allowed_scopes", Type: field.TypeJSON}, {Name: "metadata", Type: field.TypeJSON, Nullable: true}, {Name: "organization_id", Type: field.TypeUUID, Nullable: true}, } // SfPrincipalsTable holds the schema information for the "sf_principals" table. SfPrincipalsTable = &schema.Table{ Name: "sf_principals", Columns: SfPrincipalsColumns, PrimaryKey: []*schema.Column{SfPrincipalsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_principals_sf_organizations_principals", Columns: []*schema.Column{SfPrincipalsColumns[10]}, RefColumns: []*schema.Column{SfOrganizationsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "principal_identifier", Unique: true, Columns: []*schema.Column{SfPrincipalsColumns[4]}, }, { Name: "principal_type", Unique: false, Columns: []*schema.Column{SfPrincipalsColumns[3]}, }, { Name: "principal_organization_id", Unique: false, Columns: []*schema.Column{SfPrincipalsColumns[10]}, }, { Name: "principal_active", Unique: false, Columns: []*schema.Column{SfPrincipalsColumns[6]}, }, { Name: "principal_type_active", Unique: false, Columns: []*schema.Column{SfPrincipalsColumns[3], SfPrincipalsColumns[6]}, }, { Name: "principal_organization_id_type", Unique: false, Columns: []*schema.Column{SfPrincipalsColumns[10], SfPrincipalsColumns[3]}, }, }, } // SfPrincipalMembershipsColumns holds the columns for the "sf_principal_memberships" table. SfPrincipalMembershipsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "role", Type: field.TypeString}, {Name: "permissions", Type: field.TypeJSON, Nullable: true}, {Name: "active", Type: field.TypeBool, Default: true}, {Name: "organization_id", Type: field.TypeUUID}, {Name: "principal_id", Type: field.TypeUUID}, } // SfPrincipalMembershipsTable holds the schema information for the "sf_principal_memberships" table. SfPrincipalMembershipsTable = &schema.Table{ Name: "sf_principal_memberships", Columns: SfPrincipalMembershipsColumns, PrimaryKey: []*schema.Column{SfPrincipalMembershipsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_principal_memberships_sf_organizations_principal_memberships", Columns: []*schema.Column{SfPrincipalMembershipsColumns[6]}, RefColumns: []*schema.Column{SfOrganizationsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "sf_principal_memberships_sf_principals_principal_memberships", Columns: []*schema.Column{SfPrincipalMembershipsColumns[7]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "principalmembership_principal_id_organization_id", Unique: true, Columns: []*schema.Column{SfPrincipalMembershipsColumns[7], SfPrincipalMembershipsColumns[6]}, }, { Name: "principalmembership_principal_id", Unique: false, Columns: []*schema.Column{SfPrincipalMembershipsColumns[7]}, }, { Name: "principalmembership_organization_id", Unique: false, Columns: []*schema.Column{SfPrincipalMembershipsColumns[6]}, }, { Name: "principalmembership_role", Unique: false, Columns: []*schema.Column{SfPrincipalMembershipsColumns[3]}, }, { Name: "principalmembership_active", Unique: false, Columns: []*schema.Column{SfPrincipalMembershipsColumns[5]}, }, }, } // SfPrincipalTokensColumns holds the columns for the "sf_principal_tokens" table. SfPrincipalTokensColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "principal_type", Type: field.TypeEnum, Enums: []string{"human", "application", "agent", "service"}}, {Name: "access_token_signature", Type: field.TypeString, Unique: true}, {Name: "refresh_token_signature", Type: field.TypeString, Unique: true, Nullable: true}, {Name: "family_id", Type: field.TypeUUID}, {Name: "scopes", Type: field.TypeJSON}, {Name: "audience", Type: field.TypeJSON}, {Name: "capabilities", Type: field.TypeJSON}, {Name: "delegation_chain", Type: field.TypeJSON}, {Name: "dpop_jkt", Type: field.TypeString, Nullable: true}, {Name: "session_id", Type: field.TypeString, Nullable: true}, {Name: "request_data", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "access_expires_at", Type: field.TypeTime}, {Name: "refresh_expires_at", Type: field.TypeTime, Nullable: true}, {Name: "revoked", Type: field.TypeBool, Default: false}, {Name: "revoked_at", Type: field.TypeTime, Nullable: true}, {Name: "revoked_reason", Type: field.TypeString, Nullable: true}, {Name: "client_ip", Type: field.TypeString, Nullable: true}, {Name: "user_agent", Type: field.TypeString, Nullable: true}, {Name: "last_used_at", Type: field.TypeTime, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "issued_by_app_id", Type: field.TypeUUID, Nullable: true}, {Name: "principal_id", Type: field.TypeUUID}, {Name: "parent_token_id", Type: field.TypeUUID, Nullable: true}, } // SfPrincipalTokensTable holds the schema information for the "sf_principal_tokens" table. SfPrincipalTokensTable = &schema.Table{ Name: "sf_principal_tokens", Columns: SfPrincipalTokensColumns, PrimaryKey: []*schema.Column{SfPrincipalTokensColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_principal_tokens_sf_applications_issued_tokens", Columns: []*schema.Column{SfPrincipalTokensColumns[21]}, RefColumns: []*schema.Column{SfApplicationsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "sf_principal_tokens_sf_principals_principal_tokens", Columns: []*schema.Column{SfPrincipalTokensColumns[22]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "sf_principal_tokens_sf_principal_tokens_child_tokens", Columns: []*schema.Column{SfPrincipalTokensColumns[23]}, RefColumns: []*schema.Column{SfPrincipalTokensColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "principaltoken_access_token_signature", Unique: true, Columns: []*schema.Column{SfPrincipalTokensColumns[2]}, }, { Name: "principaltoken_refresh_token_signature", Unique: true, Columns: []*schema.Column{SfPrincipalTokensColumns[3]}, }, { Name: "principaltoken_principal_id", Unique: false, Columns: []*schema.Column{SfPrincipalTokensColumns[22]}, }, { Name: "principaltoken_principal_type", Unique: false, Columns: []*schema.Column{SfPrincipalTokensColumns[1]}, }, { Name: "principaltoken_issued_by_app_id", Unique: false, Columns: []*schema.Column{SfPrincipalTokensColumns[21]}, }, { Name: "principaltoken_family_id", Unique: false, Columns: []*schema.Column{SfPrincipalTokensColumns[4]}, }, { Name: "principaltoken_parent_token_id", Unique: false, Columns: []*schema.Column{SfPrincipalTokensColumns[23]}, }, { Name: "principaltoken_revoked", Unique: false, Columns: []*schema.Column{SfPrincipalTokensColumns[14]}, }, { Name: "principaltoken_access_expires_at", Unique: false, Columns: []*schema.Column{SfPrincipalTokensColumns[12]}, }, { Name: "principaltoken_session_id", Unique: false, Columns: []*schema.Column{SfPrincipalTokensColumns[10]}, }, }, } // SfResourceGrantsColumns holds the columns for the "sf_resource_grants" table. SfResourceGrantsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "resource_type", Type: field.TypeString, Size: 128}, {Name: "resource_id", Type: field.TypeString, Size: 1024}, {Name: "role", Type: field.TypeString}, {Name: "principal_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, {Name: "granted_by", Type: field.TypeUUID, Nullable: true}, } // SfResourceGrantsTable holds the schema information for the "sf_resource_grants" table. SfResourceGrantsTable = &schema.Table{ Name: "sf_resource_grants", Columns: SfResourceGrantsColumns, PrimaryKey: []*schema.Column{SfResourceGrantsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_resource_grants_sf_principals_principal", Columns: []*schema.Column{SfResourceGrantsColumns[6]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "sf_resource_grants_sf_organizations_organization", Columns: []*schema.Column{SfResourceGrantsColumns[7]}, RefColumns: []*schema.Column{SfOrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "sf_resource_grants_sf_principals_granter", Columns: []*schema.Column{SfResourceGrantsColumns[8]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "resourcegrant_principal_id_resource_type_resource_id", Unique: true, Columns: []*schema.Column{SfResourceGrantsColumns[6], SfResourceGrantsColumns[3], SfResourceGrantsColumns[4]}, }, { Name: "resourcegrant_organization_id_principal_id", Unique: false, Columns: []*schema.Column{SfResourceGrantsColumns[7], SfResourceGrantsColumns[6]}, }, { Name: "resourcegrant_resource_type_principal_id", Unique: false, Columns: []*schema.Column{SfResourceGrantsColumns[3], SfResourceGrantsColumns[6]}, }, { Name: "resourcegrant_resource_type_resource_id", Unique: false, Columns: []*schema.Column{SfResourceGrantsColumns[3], SfResourceGrantsColumns[4]}, }, }, } // SfSeatAssignmentsColumns holds the columns for the "sf_seat_assignments" table. SfSeatAssignmentsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "assigned_at", Type: field.TypeTime}, {Name: "license_id", Type: field.TypeUUID}, {Name: "principal_id", Type: field.TypeUUID}, {Name: "assigned_by", Type: field.TypeUUID}, } // SfSeatAssignmentsTable holds the schema information for the "sf_seat_assignments" table. SfSeatAssignmentsTable = &schema.Table{ Name: "sf_seat_assignments", Columns: SfSeatAssignmentsColumns, PrimaryKey: []*schema.Column{SfSeatAssignmentsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_seat_assignments_sf_licenses_seat_assignments", Columns: []*schema.Column{SfSeatAssignmentsColumns[2]}, RefColumns: []*schema.Column{SfLicensesColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "sf_seat_assignments_sf_principals_seat_assignments", Columns: []*schema.Column{SfSeatAssignmentsColumns[3]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "sf_seat_assignments_sf_principals_assigned_seats", Columns: []*schema.Column{SfSeatAssignmentsColumns[4]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "seatassignment_license_id", Unique: false, Columns: []*schema.Column{SfSeatAssignmentsColumns[2]}, }, { Name: "seatassignment_principal_id", Unique: false, Columns: []*schema.Column{SfSeatAssignmentsColumns[3]}, }, { Name: "seatassignment_assigned_by", Unique: false, Columns: []*schema.Column{SfSeatAssignmentsColumns[4]}, }, { Name: "seatassignment_license_id_principal_id", Unique: true, Columns: []*schema.Column{SfSeatAssignmentsColumns[2], SfSeatAssignmentsColumns[3]}, }, }, } // SfServicePrincipalsColumns holds the columns for the "sf_service_principals" table. SfServicePrincipalsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "service_type", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 1000}, {Name: "last_used_at", Type: field.TypeTime, Nullable: true}, {Name: "allowed_ips", Type: field.TypeJSON}, {Name: "principal_id", Type: field.TypeUUID, Unique: true}, {Name: "created_by", Type: field.TypeUUID, Nullable: true}, } // SfServicePrincipalsTable holds the schema information for the "sf_service_principals" table. SfServicePrincipalsTable = &schema.Table{ Name: "sf_service_principals", Columns: SfServicePrincipalsColumns, PrimaryKey: []*schema.Column{SfServicePrincipalsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_service_principals_sf_principals_service_principal", Columns: []*schema.Column{SfServicePrincipalsColumns[7]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "sf_service_principals_sf_principals_creator", Columns: []*schema.Column{SfServicePrincipalsColumns[8]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "serviceprincipal_principal_id", Unique: true, Columns: []*schema.Column{SfServicePrincipalsColumns[7]}, }, { Name: "serviceprincipal_service_type", Unique: false, Columns: []*schema.Column{SfServicePrincipalsColumns[3]}, }, { Name: "serviceprincipal_created_by", Unique: false, Columns: []*schema.Column{SfServicePrincipalsColumns[8]}, }, }, } // SfSlugReservationsColumns holds the columns for the "sf_slug_reservations" table. SfSlugReservationsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "slug", Type: field.TypeString, Unique: true}, {Name: "released_at", Type: field.TypeTime}, {Name: "expires_at", Type: field.TypeTime}, {Name: "released_by_principal_id", Type: field.TypeUUID}, {Name: "released_from_organization_id", Type: field.TypeUUID, Nullable: true}, } // SfSlugReservationsTable holds the schema information for the "sf_slug_reservations" table. SfSlugReservationsTable = &schema.Table{ Name: "sf_slug_reservations", Columns: SfSlugReservationsColumns, PrimaryKey: []*schema.Column{SfSlugReservationsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_slug_reservations_sf_principals_released_by", Columns: []*schema.Column{SfSlugReservationsColumns[6]}, RefColumns: []*schema.Column{SfPrincipalsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "sf_slug_reservations_sf_organizations_released_from", Columns: []*schema.Column{SfSlugReservationsColumns[7]}, RefColumns: []*schema.Column{SfOrganizationsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "slugreservation_expires_at", Unique: false, Columns: []*schema.Column{SfSlugReservationsColumns[5]}, }, }, } // SfSubscriptionsColumns holds the columns for the "sf_subscriptions" table. SfSubscriptionsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "listing_id", Type: field.TypeUUID, Nullable: true}, {Name: "plan_tier", Type: field.TypeString, Default: "free"}, {Name: "status", Type: field.TypeEnum, Enums: []string{"active", "trialing", "past_due", "canceled", "unpaid"}, Default: "active"}, {Name: "current_period_start", Type: field.TypeTime}, {Name: "current_period_end", Type: field.TypeTime}, {Name: "stripe_subscription_id", Type: field.TypeString, Unique: true, Nullable: true}, {Name: "stripe_customer_id", Type: field.TypeString, Nullable: true}, {Name: "cancel_at_period_end", Type: field.TypeBool, Default: false}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "organization_id", Type: field.TypeUUID}, } // SfSubscriptionsTable holds the schema information for the "sf_subscriptions" table. SfSubscriptionsTable = &schema.Table{ Name: "sf_subscriptions", Columns: SfSubscriptionsColumns, PrimaryKey: []*schema.Column{SfSubscriptionsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sf_subscriptions_sf_organizations_subscriptions", Columns: []*schema.Column{SfSubscriptionsColumns[11]}, RefColumns: []*schema.Column{SfOrganizationsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "subscription_organization_id", Unique: false, Columns: []*schema.Column{SfSubscriptionsColumns[11]}, }, { Name: "subscription_organization_id_listing_id", Unique: true, Columns: []*schema.Column{SfSubscriptionsColumns[11], SfSubscriptionsColumns[1]}, }, { Name: "subscription_platform_per_org", Unique: true, Columns: []*schema.Column{SfSubscriptionsColumns[11]}, Annotation: &entsql.IndexAnnotation{ Where: "listing_id IS NULL", }, }, { Name: "subscription_listing_id", Unique: false, Columns: []*schema.Column{SfSubscriptionsColumns[1]}, }, { Name: "subscription_status", Unique: false, Columns: []*schema.Column{SfSubscriptionsColumns[3]}, }, { Name: "subscription_plan_tier", Unique: false, Columns: []*schema.Column{SfSubscriptionsColumns[2]}, }, { Name: "subscription_stripe_subscription_id", Unique: false, Columns: []*schema.Column{SfSubscriptionsColumns[6]}, }, { Name: "subscription_stripe_customer_id", Unique: false, Columns: []*schema.Column{SfSubscriptionsColumns[7]}, }, { Name: "subscription_current_period_end", Unique: false, Columns: []*schema.Column{SfSubscriptionsColumns[5]}, }, { Name: "subscription_status_current_period_end", Unique: false, Columns: []*schema.Column{SfSubscriptionsColumns[3], SfSubscriptionsColumns[5]}, }, }, } // Tables holds all the tables in the schema. Tables = []*schema.Table{ SfAccessChangesTable, SfAgentsTable, SfAppRolesTable, SfApplicationsTable, SfClientAssertionJtisTable, SfConsentGrantsTable, SfCredentialsTable, SfExternalIdentitiesTable, SfHumansTable, SfInvitesTable, SfLicensesTable, SfListingsTable, SfLoginSessionsTable, SfLoginStatesTable, SfManagerClaimsTable, SfManagerInvitesTable, SfManagerRelationshipsTable, SfOauthAppsTable, SfOauthAppSecretsTable, SfOauthAuthCodesTable, SfOauthConsentsTable, SfOauthTokensTable, SfOrganizationsTable, SfPrincipalsTable, SfPrincipalMembershipsTable, SfPrincipalTokensTable, SfResourceGrantsTable, SfSeatAssignmentsTable, SfServicePrincipalsTable, SfSlugReservationsTable, SfSubscriptionsTable, } )
Functions ¶
Types ¶
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
Schema is the API for creating, migrating and dropping a schema.
Click to show internal directories.
Click to hide internal directories.