310 lines
6.5 KiB
JSON
310 lines
6.5 KiB
JSON
{
|
|
"version": 2,
|
|
"tables": [
|
|
{
|
|
"table": {
|
|
"schema": "auth",
|
|
"name": "account_providers"
|
|
},
|
|
"object_relationships": [
|
|
{
|
|
"name": "account",
|
|
"using": {
|
|
"foreign_key_constraint_on": "account_id"
|
|
}
|
|
},
|
|
{
|
|
"name": "provider",
|
|
"using": {
|
|
"foreign_key_constraint_on": "auth_provider"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"table": {
|
|
"schema": "auth",
|
|
"name": "account_roles"
|
|
},
|
|
"object_relationships": [
|
|
{
|
|
"name": "account",
|
|
"using": {
|
|
"foreign_key_constraint_on": "account_id"
|
|
}
|
|
},
|
|
{
|
|
"name": "roleByRole",
|
|
"using": {
|
|
"foreign_key_constraint_on": "role"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"table": {
|
|
"schema": "auth",
|
|
"name": "accounts"
|
|
},
|
|
"object_relationships": [
|
|
{
|
|
"name": "role",
|
|
"using": {
|
|
"foreign_key_constraint_on": "default_role"
|
|
}
|
|
},
|
|
{
|
|
"name": "user",
|
|
"using": {
|
|
"foreign_key_constraint_on": "user_id"
|
|
}
|
|
}
|
|
],
|
|
"array_relationships": [
|
|
{
|
|
"name": "account_providers",
|
|
"using": {
|
|
"foreign_key_constraint_on": {
|
|
"column": "account_id",
|
|
"table": {
|
|
"schema": "auth",
|
|
"name": "account_providers"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "account_roles",
|
|
"using": {
|
|
"foreign_key_constraint_on": {
|
|
"column": "account_id",
|
|
"table": {
|
|
"schema": "auth",
|
|
"name": "account_roles"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "refresh_tokens",
|
|
"using": {
|
|
"foreign_key_constraint_on": {
|
|
"column": "account_id",
|
|
"table": {
|
|
"schema": "auth",
|
|
"name": "refresh_tokens"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"select_permissions": [
|
|
{
|
|
"role": "me",
|
|
"permission": {
|
|
"columns": ["email", "id"],
|
|
"filter": {
|
|
"user_id": {
|
|
"_eq": "X-Hasura-User-Id"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"table": {
|
|
"schema": "auth",
|
|
"name": "providers"
|
|
},
|
|
"array_relationships": [
|
|
{
|
|
"name": "account_providers",
|
|
"using": {
|
|
"foreign_key_constraint_on": {
|
|
"column": "auth_provider",
|
|
"table": {
|
|
"schema": "auth",
|
|
"name": "account_providers"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"table": {
|
|
"schema": "auth",
|
|
"name": "refresh_tokens"
|
|
},
|
|
"object_relationships": [
|
|
{
|
|
"name": "account",
|
|
"using": {
|
|
"foreign_key_constraint_on": "account_id"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"table": {
|
|
"schema": "auth",
|
|
"name": "roles"
|
|
},
|
|
"array_relationships": [
|
|
{
|
|
"name": "account_roles",
|
|
"using": {
|
|
"foreign_key_constraint_on": {
|
|
"column": "role",
|
|
"table": {
|
|
"schema": "auth",
|
|
"name": "account_roles"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "accounts",
|
|
"using": {
|
|
"foreign_key_constraint_on": {
|
|
"column": "default_role",
|
|
"table": {
|
|
"schema": "auth",
|
|
"name": "accounts"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"table": {
|
|
"schema": "public",
|
|
"name": "items"
|
|
},
|
|
"object_relationships": [
|
|
{
|
|
"name": "user",
|
|
"using": {
|
|
"foreign_key_constraint_on": "user_id"
|
|
}
|
|
}
|
|
],
|
|
"insert_permissions": [
|
|
{
|
|
"role": "user",
|
|
"permission": {
|
|
"check": {
|
|
"user_id": {
|
|
"_eq": "X-Hasura-User-Id"
|
|
}
|
|
},
|
|
"set": {
|
|
"user_id": "x-hasura-user-id"
|
|
},
|
|
"columns": ["name"],
|
|
"backend_only": false
|
|
}
|
|
}
|
|
],
|
|
"select_permissions": [
|
|
{
|
|
"role": "user",
|
|
"permission": {
|
|
"columns": ["id", "created_at", "name", "user_id"],
|
|
"filter": {
|
|
"user_id": {
|
|
"_eq": "X-Hasura-User-Id"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"delete_permissions": [
|
|
{
|
|
"role": "user",
|
|
"permission": {
|
|
"filter": {
|
|
"user_id": {
|
|
"_eq": "X-Hasura-User-Id"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"table": {
|
|
"schema": "public",
|
|
"name": "users"
|
|
},
|
|
"object_relationships": [
|
|
{
|
|
"name": "account",
|
|
"using": {
|
|
"manual_configuration": {
|
|
"remote_table": {
|
|
"schema": "auth",
|
|
"name": "accounts"
|
|
},
|
|
"column_mapping": {
|
|
"id": "user_id"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"array_relationships": [
|
|
{
|
|
"name": "items",
|
|
"using": {
|
|
"foreign_key_constraint_on": {
|
|
"column": "user_id",
|
|
"table": {
|
|
"schema": "public",
|
|
"name": "items"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"select_permissions": [
|
|
{
|
|
"role": "me",
|
|
"permission": {
|
|
"columns": [
|
|
"id",
|
|
"created_at",
|
|
"updated_at",
|
|
"display_name",
|
|
"avatar_url"
|
|
],
|
|
"filter": {
|
|
"id": {
|
|
"_eq": "X-Hasura-User-Id"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"role": "user",
|
|
"permission": {
|
|
"columns": [
|
|
"id",
|
|
"created_at",
|
|
"updated_at",
|
|
"display_name",
|
|
"avatar_url"
|
|
],
|
|
"filter": {
|
|
"id": {
|
|
"_eq": "X-Hasura-User-Id"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|