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 ( // CfAPIKeysColumns holds the columns for the "cf_api_keys" table. CfAPIKeysColumns = []*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: "prefix", Type: field.TypeString, Unique: true}, {Name: "key_hash", Type: field.TypeString}, {Name: "scopes", Type: field.TypeJSON, Nullable: true}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "expires_at", Type: field.TypeTime, Nullable: true}, {Name: "last_used_at", Type: field.TypeTime, Nullable: true}, {Name: "last_used_ip", Type: field.TypeString, 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: "environment", Type: field.TypeEnum, Enums: []string{"live", "test"}, Default: "live"}, {Name: "metadata", Type: field.TypeJSON, Nullable: true}, {Name: "organization_api_keys", Type: field.TypeUUID, Nullable: true}, {Name: "user_api_keys", Type: field.TypeUUID}, } // CfAPIKeysTable holds the schema information for the "cf_api_keys" table. CfAPIKeysTable = &schema.Table{ Name: "cf_api_keys", Columns: CfAPIKeysColumns, PrimaryKey: []*schema.Column{CfAPIKeysColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "cf_api_keys_cf_organizations_api_keys", Columns: []*schema.Column{CfAPIKeysColumns[16]}, RefColumns: []*schema.Column{CfOrganizationsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "cf_api_keys_cf_users_api_keys", Columns: []*schema.Column{CfAPIKeysColumns[17]}, RefColumns: []*schema.Column{CfUsersColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "apikey_prefix", Unique: true, Columns: []*schema.Column{CfAPIKeysColumns[4]}, }, { Name: "apikey_user_api_keys", Unique: false, Columns: []*schema.Column{CfAPIKeysColumns[17]}, }, { Name: "apikey_organization_api_keys", Unique: false, Columns: []*schema.Column{CfAPIKeysColumns[16]}, }, { Name: "apikey_revoked_expires_at", Unique: false, Columns: []*schema.Column{CfAPIKeysColumns[11], CfAPIKeysColumns[8]}, }, { Name: "apikey_environment", Unique: false, Columns: []*schema.Column{CfAPIKeysColumns[14]}, }, }, } // CfMembershipsColumns holds the columns for the "cf_memberships" table. CfMembershipsColumns = []*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: "organization_id", Type: field.TypeUUID}, {Name: "user_id", Type: field.TypeUUID}, } // CfMembershipsTable holds the schema information for the "cf_memberships" table. CfMembershipsTable = &schema.Table{ Name: "cf_memberships", Columns: CfMembershipsColumns, PrimaryKey: []*schema.Column{CfMembershipsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "cf_memberships_cf_organizations_memberships", Columns: []*schema.Column{CfMembershipsColumns[5]}, RefColumns: []*schema.Column{CfOrganizationsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "cf_memberships_cf_users_memberships", Columns: []*schema.Column{CfMembershipsColumns[6]}, RefColumns: []*schema.Column{CfUsersColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "membership_user_id_organization_id", Unique: true, Columns: []*schema.Column{CfMembershipsColumns[6], CfMembershipsColumns[5]}, }, { Name: "membership_user_id", Unique: false, Columns: []*schema.Column{CfMembershipsColumns[6]}, }, { Name: "membership_organization_id", Unique: false, Columns: []*schema.Column{CfMembershipsColumns[5]}, }, { Name: "membership_role", Unique: false, Columns: []*schema.Column{CfMembershipsColumns[3]}, }, }, } // CfOauthAccountsColumns holds the columns for the "cf_oauth_accounts" table. CfOauthAccountsColumns = []*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: "provider_user_id", Type: field.TypeString}, {Name: "access_token", Type: field.TypeString, Nullable: true}, {Name: "refresh_token", Type: field.TypeString, Nullable: true}, {Name: "token_expires_at", Type: field.TypeTime, Nullable: true}, {Name: "user_id", Type: field.TypeUUID}, } // CfOauthAccountsTable holds the schema information for the "cf_oauth_accounts" table. CfOauthAccountsTable = &schema.Table{ Name: "cf_oauth_accounts", Columns: CfOauthAccountsColumns, PrimaryKey: []*schema.Column{CfOauthAccountsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "cf_oauth_accounts_cf_users_oauth_accounts", Columns: []*schema.Column{CfOauthAccountsColumns[8]}, RefColumns: []*schema.Column{CfUsersColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "oauthaccount_provider_provider_user_id", Unique: true, Columns: []*schema.Column{CfOauthAccountsColumns[3], CfOauthAccountsColumns[4]}, }, { Name: "oauthaccount_user_id", Unique: false, Columns: []*schema.Column{CfOauthAccountsColumns[8]}, }, { Name: "oauthaccount_provider", Unique: false, Columns: []*schema.Column{CfOauthAccountsColumns[3]}, }, }, } // CfOauthAppsColumns holds the columns for the "cf_oauth_apps" table. CfOauthAppsColumns = []*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: 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: "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}, } // CfOauthAppsTable holds the schema information for the "cf_oauth_apps" table. CfOauthAppsTable = &schema.Table{ Name: "cf_oauth_apps", Columns: CfOauthAppsColumns, PrimaryKey: []*schema.Column{CfOauthAppsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "cf_oauth_apps_cf_organizations_oauth_apps", Columns: []*schema.Column{CfOauthAppsColumns[20]}, RefColumns: []*schema.Column{CfOrganizationsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "cf_oauth_apps_cf_users_oauth_apps", Columns: []*schema.Column{CfOauthAppsColumns[21]}, RefColumns: []*schema.Column{CfUsersColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "oauthapp_client_id", Unique: true, Columns: []*schema.Column{CfOauthAppsColumns[1]}, }, { Name: "oauthapp_owner_id", Unique: false, Columns: []*schema.Column{CfOauthAppsColumns[21]}, }, { Name: "oauthapp_organization_id", Unique: false, Columns: []*schema.Column{CfOauthAppsColumns[20]}, }, { Name: "oauthapp_active", Unique: false, Columns: []*schema.Column{CfOauthAppsColumns[15]}, }, }, } // CfOauthAppSecretsColumns holds the columns for the "cf_oauth_app_secrets" table. CfOauthAppSecretsColumns = []*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}, } // CfOauthAppSecretsTable holds the schema information for the "cf_oauth_app_secrets" table. CfOauthAppSecretsTable = &schema.Table{ Name: "cf_oauth_app_secrets", Columns: CfOauthAppSecretsColumns, PrimaryKey: []*schema.Column{CfOauthAppSecretsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "cf_oauth_app_secrets_cf_oauth_apps_secrets", Columns: []*schema.Column{CfOauthAppSecretsColumns[8]}, RefColumns: []*schema.Column{CfOauthAppsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "oauthappsecret_app_id", Unique: false, Columns: []*schema.Column{CfOauthAppSecretsColumns[8]}, }, { Name: "oauthappsecret_app_id_revoked", Unique: false, Columns: []*schema.Column{CfOauthAppSecretsColumns[8], CfOauthAppSecretsColumns[5]}, }, }, } // CfOauthAuthCodesColumns holds the columns for the "cf_oauth_auth_codes" table. CfOauthAuthCodesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "code_signature", Type: field.TypeString, Unique: 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}, {Name: "user_id", Type: field.TypeUUID}, } // CfOauthAuthCodesTable holds the schema information for the "cf_oauth_auth_codes" table. CfOauthAuthCodesTable = &schema.Table{ Name: "cf_oauth_auth_codes", Columns: CfOauthAuthCodesColumns, PrimaryKey: []*schema.Column{CfOauthAuthCodesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "cf_oauth_auth_codes_cf_oauth_apps_auth_codes", Columns: []*schema.Column{CfOauthAuthCodesColumns[15]}, RefColumns: []*schema.Column{CfOauthAppsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "cf_oauth_auth_codes_cf_users_oauth_auth_codes", Columns: []*schema.Column{CfOauthAuthCodesColumns[16]}, RefColumns: []*schema.Column{CfUsersColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "oauthauthcode_code_signature", Unique: true, Columns: []*schema.Column{CfOauthAuthCodesColumns[1]}, }, { Name: "oauthauthcode_app_id", Unique: false, Columns: []*schema.Column{CfOauthAuthCodesColumns[15]}, }, { Name: "oauthauthcode_user_id", Unique: false, Columns: []*schema.Column{CfOauthAuthCodesColumns[16]}, }, { Name: "oauthauthcode_expires_at", Unique: false, Columns: []*schema.Column{CfOauthAuthCodesColumns[9]}, }, { Name: "oauthauthcode_used", Unique: false, Columns: []*schema.Column{CfOauthAuthCodesColumns[10]}, }, }, } // CfOauthConsentsColumns holds the columns for the "cf_oauth_consents" table. CfOauthConsentsColumns = []*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: "user_id", Type: field.TypeUUID}, } // CfOauthConsentsTable holds the schema information for the "cf_oauth_consents" table. CfOauthConsentsTable = &schema.Table{ Name: "cf_oauth_consents", Columns: CfOauthConsentsColumns, PrimaryKey: []*schema.Column{CfOauthConsentsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "cf_oauth_consents_cf_oauth_apps_consents", Columns: []*schema.Column{CfOauthConsentsColumns[10]}, RefColumns: []*schema.Column{CfOauthAppsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "cf_oauth_consents_cf_users_oauth_consents", Columns: []*schema.Column{CfOauthConsentsColumns[11]}, RefColumns: []*schema.Column{CfUsersColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "oauthconsent_user_id_app_id", Unique: true, Columns: []*schema.Column{CfOauthConsentsColumns[11], CfOauthConsentsColumns[10]}, }, { Name: "oauthconsent_user_id", Unique: false, Columns: []*schema.Column{CfOauthConsentsColumns[11]}, }, { Name: "oauthconsent_app_id", Unique: false, Columns: []*schema.Column{CfOauthConsentsColumns[10]}, }, { Name: "oauthconsent_granted", Unique: false, Columns: []*schema.Column{CfOauthConsentsColumns[2]}, }, { Name: "oauthconsent_revoked", Unique: false, Columns: []*schema.Column{CfOauthConsentsColumns[5]}, }, }, } // CfOauthTokensColumns holds the columns for the "cf_oauth_tokens" table. CfOauthTokensColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "service_account_id", Type: field.TypeUUID, 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}, {Name: "user_id", Type: field.TypeUUID, Nullable: true}, } // CfOauthTokensTable holds the schema information for the "cf_oauth_tokens" table. CfOauthTokensTable = &schema.Table{ Name: "cf_oauth_tokens", Columns: CfOauthTokensColumns, PrimaryKey: []*schema.Column{CfOauthTokensColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "cf_oauth_tokens_cf_oauth_apps_tokens", Columns: []*schema.Column{CfOauthTokensColumns[18]}, RefColumns: []*schema.Column{CfOauthAppsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "cf_oauth_tokens_cf_users_oauth_tokens", Columns: []*schema.Column{CfOauthTokensColumns[19]}, RefColumns: []*schema.Column{CfUsersColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "oauthtoken_access_token_signature", Unique: true, Columns: []*schema.Column{CfOauthTokensColumns[2]}, }, { Name: "oauthtoken_refresh_token_signature", Unique: true, Columns: []*schema.Column{CfOauthTokensColumns[3]}, }, { Name: "oauthtoken_app_id", Unique: false, Columns: []*schema.Column{CfOauthTokensColumns[18]}, }, { Name: "oauthtoken_user_id", Unique: false, Columns: []*schema.Column{CfOauthTokensColumns[19]}, }, { Name: "oauthtoken_family_id", Unique: false, Columns: []*schema.Column{CfOauthTokensColumns[4]}, }, { Name: "oauthtoken_revoked", Unique: false, Columns: []*schema.Column{CfOauthTokensColumns[11]}, }, { Name: "oauthtoken_access_expires_at", Unique: false, Columns: []*schema.Column{CfOauthTokensColumns[9]}, }, }, } // CfOrganizationsColumns holds the columns for the "cf_organizations" table. CfOrganizationsColumns = []*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: "logo_url", Type: field.TypeString, Nullable: true}, {Name: "settings", Type: field.TypeJSON, Nullable: true}, {Name: "plan", Type: field.TypeEnum, Enums: []string{"free", "starter", "pro", "enterprise"}, Default: "free"}, {Name: "active", Type: field.TypeBool, Default: true}, } // CfOrganizationsTable holds the schema information for the "cf_organizations" table. CfOrganizationsTable = &schema.Table{ Name: "cf_organizations", Columns: CfOrganizationsColumns, PrimaryKey: []*schema.Column{CfOrganizationsColumns[0]}, Indexes: []*schema.Index{ { Name: "organization_slug", Unique: true, Columns: []*schema.Column{CfOrganizationsColumns[4]}, }, { Name: "organization_active", Unique: false, Columns: []*schema.Column{CfOrganizationsColumns[8]}, }, }, } // CfRefreshTokensColumns holds the columns for the "cf_refresh_tokens" table. CfRefreshTokensColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "token", Type: field.TypeString, Unique: true}, {Name: "family", Type: field.TypeString}, {Name: "expires_at", Type: field.TypeTime}, {Name: "revoked", Type: field.TypeBool, Default: false}, {Name: "user_agent", Type: field.TypeString, Nullable: true}, {Name: "ip_address", Type: field.TypeString, Nullable: true}, {Name: "user_id", Type: field.TypeUUID}, } // CfRefreshTokensTable holds the schema information for the "cf_refresh_tokens" table. CfRefreshTokensTable = &schema.Table{ Name: "cf_refresh_tokens", Columns: CfRefreshTokensColumns, PrimaryKey: []*schema.Column{CfRefreshTokensColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "cf_refresh_tokens_cf_users_refresh_tokens", Columns: []*schema.Column{CfRefreshTokensColumns[9]}, RefColumns: []*schema.Column{CfUsersColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "refreshtoken_token", Unique: true, Columns: []*schema.Column{CfRefreshTokensColumns[3]}, }, { Name: "refreshtoken_user_id", Unique: false, Columns: []*schema.Column{CfRefreshTokensColumns[9]}, }, { Name: "refreshtoken_family", Unique: false, Columns: []*schema.Column{CfRefreshTokensColumns[4]}, }, { Name: "refreshtoken_expires_at", Unique: false, Columns: []*schema.Column{CfRefreshTokensColumns[5]}, }, { Name: "refreshtoken_revoked", Unique: false, Columns: []*schema.Column{CfRefreshTokensColumns[6]}, }, }, } // CfServiceAccountsColumns holds the columns for the "cf_service_accounts" table. CfServiceAccountsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "name", Type: field.TypeString, Size: 255}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 1000}, {Name: "email", Type: field.TypeString, Unique: true}, {Name: "allowed_scopes", Type: field.TypeJSON}, {Name: "active", Type: field.TypeBool, Default: true}, {Name: "last_used_at", Type: field.TypeTime, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "organization_id", Type: field.TypeUUID}, {Name: "created_by", Type: field.TypeUUID}, } // CfServiceAccountsTable holds the schema information for the "cf_service_accounts" table. CfServiceAccountsTable = &schema.Table{ Name: "cf_service_accounts", Columns: CfServiceAccountsColumns, PrimaryKey: []*schema.Column{CfServiceAccountsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "cf_service_accounts_cf_organizations_service_accounts", Columns: []*schema.Column{CfServiceAccountsColumns[9]}, RefColumns: []*schema.Column{CfOrganizationsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "cf_service_accounts_cf_users_created_service_accounts", Columns: []*schema.Column{CfServiceAccountsColumns[10]}, RefColumns: []*schema.Column{CfUsersColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "serviceaccount_email", Unique: true, Columns: []*schema.Column{CfServiceAccountsColumns[3]}, }, { Name: "serviceaccount_organization_id", Unique: false, Columns: []*schema.Column{CfServiceAccountsColumns[9]}, }, { Name: "serviceaccount_active", Unique: false, Columns: []*schema.Column{CfServiceAccountsColumns[5]}, }, }, } // CfServiceAccountKeyPairsColumns holds the columns for the "cf_service_account_key_pairs" table. CfServiceAccountKeyPairsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "key_id", Type: field.TypeString}, {Name: "key_type", Type: field.TypeEnum, Enums: []string{"rsa", "ec"}, Default: "rsa"}, {Name: "algorithm", Type: field.TypeEnum, Enums: []string{"RS256", "RS384", "RS512", "ES256", "ES384", "ES512"}, Default: "RS256"}, {Name: "public_key_pem", Type: field.TypeString, Size: 2147483647}, {Name: "expires_at", Type: field.TypeTime, Nullable: true}, {Name: "active", Type: field.TypeBool, Default: 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: "service_account_id", Type: field.TypeUUID}, } // CfServiceAccountKeyPairsTable holds the schema information for the "cf_service_account_key_pairs" table. CfServiceAccountKeyPairsTable = &schema.Table{ Name: "cf_service_account_key_pairs", Columns: CfServiceAccountKeyPairsColumns, PrimaryKey: []*schema.Column{CfServiceAccountKeyPairsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "cf_service_account_key_pairs_cf_service_accounts_key_pairs", Columns: []*schema.Column{CfServiceAccountKeyPairsColumns[11]}, RefColumns: []*schema.Column{CfServiceAccountsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "serviceaccountkeypair_service_account_id_key_id", Unique: true, Columns: []*schema.Column{CfServiceAccountKeyPairsColumns[11], CfServiceAccountKeyPairsColumns[1]}, }, { Name: "serviceaccountkeypair_service_account_id", Unique: false, Columns: []*schema.Column{CfServiceAccountKeyPairsColumns[11]}, }, { Name: "serviceaccountkeypair_active", Unique: false, Columns: []*schema.Column{CfServiceAccountKeyPairsColumns[6]}, }, { Name: "serviceaccountkeypair_revoked", Unique: false, Columns: []*schema.Column{CfServiceAccountKeyPairsColumns[8]}, }, }, } // CfUsersColumns holds the columns for the "cf_users" table. CfUsersColumns = []*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}, {Name: "name", Type: field.TypeString}, {Name: "avatar_url", Type: field.TypeString, Nullable: true}, {Name: "password_hash", Type: field.TypeString, Nullable: true}, {Name: "is_platform_admin", Type: field.TypeBool, Default: false}, {Name: "active", Type: field.TypeBool, Default: true}, {Name: "last_login_at", Type: field.TypeTime, Nullable: true}, } // CfUsersTable holds the schema information for the "cf_users" table. CfUsersTable = &schema.Table{ Name: "cf_users", Columns: CfUsersColumns, PrimaryKey: []*schema.Column{CfUsersColumns[0]}, Indexes: []*schema.Index{ { Name: "user_email", Unique: true, Columns: []*schema.Column{CfUsersColumns[3]}, }, { Name: "user_active", Unique: false, Columns: []*schema.Column{CfUsersColumns[8]}, }, }, } // Tables holds all the tables in the schema. Tables = []*schema.Table{ CfAPIKeysTable, CfMembershipsTable, CfOauthAccountsTable, CfOauthAppsTable, CfOauthAppSecretsTable, CfOauthAuthCodesTable, CfOauthConsentsTable, CfOauthTokensTable, CfOrganizationsTable, CfRefreshTokensTable, CfServiceAccountsTable, CfServiceAccountKeyPairsTable, CfUsersTable, } )
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.