schema.go•51.8 kB
// Code generated by ent, DO NOT EDIT.
package migrate
import (
"entgo.io/ent/dialect/sql/schema"
"entgo.io/ent/schema/field"
)
var (
// AccountsColumns holds the columns for the "accounts" table.
AccountsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "updated_at", Type: field.TypeTime},
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
{Name: "indexed_at", Type: field.TypeTime, Nullable: true},
{Name: "handle", Type: field.TypeString, Unique: true},
{Name: "name", Type: field.TypeString},
{Name: "bio", Type: field.TypeString, Nullable: true},
{Name: "kind", Type: field.TypeEnum, Enums: []string{"human", "bot"}, Default: "human"},
{Name: "admin", Type: field.TypeBool, Default: false},
{Name: "links", Type: field.TypeJSON, Nullable: true},
{Name: "metadata", Type: field.TypeJSON, Nullable: true},
{Name: "invited_by_id", Type: field.TypeString, Nullable: true, Size: 20},
}
// AccountsTable holds the schema information for the "accounts" table.
AccountsTable = &schema.Table{
Name: "accounts",
Columns: AccountsColumns,
PrimaryKey: []*schema.Column{AccountsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "accounts_invitations_invited",
Columns: []*schema.Column{AccountsColumns[12]},
RefColumns: []*schema.Column{InvitationsColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// AccountFollowsColumns holds the columns for the "account_follows" table.
AccountFollowsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "follower_account_id", Type: field.TypeString, Size: 20},
{Name: "following_account_id", Type: field.TypeString, Size: 20},
}
// AccountFollowsTable holds the schema information for the "account_follows" table.
AccountFollowsTable = &schema.Table{
Name: "account_follows",
Columns: AccountFollowsColumns,
PrimaryKey: []*schema.Column{AccountFollowsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "account_follows_accounts_following",
Columns: []*schema.Column{AccountFollowsColumns[2]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "account_follows_accounts_followed_by",
Columns: []*schema.Column{AccountFollowsColumns[3]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.Cascade,
},
},
Indexes: []*schema.Index{
{
Name: "unique_following_pair",
Unique: true,
Columns: []*schema.Column{AccountFollowsColumns[2], AccountFollowsColumns[3]},
},
},
}
// AccountRolesColumns holds the columns for the "account_roles" table.
AccountRolesColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "badge", Type: field.TypeBool, Nullable: true},
{Name: "account_id", Type: field.TypeString, Size: 20},
{Name: "role_id", Type: field.TypeString, Size: 20},
}
// AccountRolesTable holds the schema information for the "account_roles" table.
AccountRolesTable = &schema.Table{
Name: "account_roles",
Columns: AccountRolesColumns,
PrimaryKey: []*schema.Column{AccountRolesColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "account_roles_accounts_account",
Columns: []*schema.Column{AccountRolesColumns[3]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "account_roles_roles_role",
Columns: []*schema.Column{AccountRolesColumns[4]},
RefColumns: []*schema.Column{RolesColumns[0]},
OnDelete: schema.Cascade,
},
},
Indexes: []*schema.Index{
{
Name: "unique_account_role",
Unique: true,
Columns: []*schema.Column{AccountRolesColumns[3], AccountRolesColumns[4]},
},
{
Name: "accountroles_account_id_badge",
Unique: true,
Columns: []*schema.Column{AccountRolesColumns[3], AccountRolesColumns[2]},
},
},
}
// AssetsColumns holds the columns for the "assets" table.
AssetsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "updated_at", Type: field.TypeTime},
{Name: "filename", Type: field.TypeString},
{Name: "size", Type: field.TypeInt, Default: "0"},
{Name: "mime_type", Type: field.TypeString, Default: "application/octet-stream"},
{Name: "metadata", Type: field.TypeJSON, Nullable: true},
{Name: "account_id", Type: field.TypeString, Size: 20},
{Name: "parent_asset_id", Type: field.TypeString, Nullable: true, Size: 20},
}
// AssetsTable holds the schema information for the "assets" table.
AssetsTable = &schema.Table{
Name: "assets",
Columns: AssetsColumns,
PrimaryKey: []*schema.Column{AssetsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "assets_accounts_assets",
Columns: []*schema.Column{AssetsColumns[7]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "assets_assets_assets",
Columns: []*schema.Column{AssetsColumns[8]},
RefColumns: []*schema.Column{AssetsColumns[0]},
OnDelete: schema.SetNull,
},
},
Indexes: []*schema.Index{
{
Name: "asset_filename",
Unique: false,
Columns: []*schema.Column{AssetsColumns[3]},
},
},
}
// AuthenticationsColumns holds the columns for the "authentications" table.
AuthenticationsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "expires_at", Type: field.TypeTime, Nullable: true},
{Name: "service", Type: field.TypeString},
{Name: "token_type", Type: field.TypeString},
{Name: "identifier", Type: field.TypeString},
{Name: "token", Type: field.TypeString},
{Name: "name", Type: field.TypeString, Nullable: true},
{Name: "disabled", Type: field.TypeBool, Default: false},
{Name: "metadata", Type: field.TypeJSON, Nullable: true},
{Name: "account_authentication", Type: field.TypeString, Size: 20},
}
// AuthenticationsTable holds the schema information for the "authentications" table.
AuthenticationsTable = &schema.Table{
Name: "authentications",
Columns: AuthenticationsColumns,
PrimaryKey: []*schema.Column{AuthenticationsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "authentications_accounts_authentication",
Columns: []*schema.Column{AuthenticationsColumns[10]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.Cascade,
},
},
Indexes: []*schema.Index{
{
Name: "authentication_service_identifier_account_authentication",
Unique: true,
Columns: []*schema.Column{AuthenticationsColumns[3], AuthenticationsColumns[5], AuthenticationsColumns[10]},
},
{
Name: "authentication_token_type_identifier_account_authentication",
Unique: true,
Columns: []*schema.Column{AuthenticationsColumns[4], AuthenticationsColumns[5], AuthenticationsColumns[10]},
},
},
}
// CategoriesColumns holds the columns for the "categories" table.
CategoriesColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "updated_at", Type: field.TypeTime},
{Name: "name", Type: field.TypeString, Unique: true},
{Name: "slug", Type: field.TypeString, Unique: true},
{Name: "description", Type: field.TypeString, Default: "(No description)"},
{Name: "colour", Type: field.TypeString, Default: "#8577ce"},
{Name: "sort", Type: field.TypeInt, Default: -1},
{Name: "admin", Type: field.TypeBool, Default: false},
{Name: "metadata", Type: field.TypeJSON, Nullable: true},
{Name: "parent_category_id", Type: field.TypeString, Nullable: true, Size: 20},
{Name: "cover_image_asset_id", Type: field.TypeString, Nullable: true, Size: 20},
}
// CategoriesTable holds the schema information for the "categories" table.
CategoriesTable = &schema.Table{
Name: "categories",
Columns: CategoriesColumns,
PrimaryKey: []*schema.Column{CategoriesColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "categories_categories_children",
Columns: []*schema.Column{CategoriesColumns[10]},
RefColumns: []*schema.Column{CategoriesColumns[0]},
OnDelete: schema.SetNull,
},
{
Symbol: "categories_assets_cover_image",
Columns: []*schema.Column{CategoriesColumns[11]},
RefColumns: []*schema.Column{AssetsColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// CollectionsColumns holds the columns for the "collections" table.
CollectionsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "updated_at", Type: field.TypeTime},
{Name: "indexed_at", Type: field.TypeTime, Nullable: true},
{Name: "name", Type: field.TypeString},
{Name: "slug", Type: field.TypeString},
{Name: "description", Type: field.TypeString, Nullable: true},
{Name: "visibility", Type: field.TypeEnum, Enums: []string{"draft", "unlisted", "review", "published"}, Default: "draft"},
{Name: "account_collections", Type: field.TypeString, Nullable: true, Size: 20},
{Name: "cover_asset_id", Type: field.TypeString, Nullable: true, Size: 20},
}
// CollectionsTable holds the schema information for the "collections" table.
CollectionsTable = &schema.Table{
Name: "collections",
Columns: CollectionsColumns,
PrimaryKey: []*schema.Column{CollectionsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "collections_accounts_collections",
Columns: []*schema.Column{CollectionsColumns[8]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "collections_assets_cover_image",
Columns: []*schema.Column{CollectionsColumns[9]},
RefColumns: []*schema.Column{AssetsColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// CollectionNodesColumns holds the columns for the "collection_nodes" table.
CollectionNodesColumns = []*schema.Column{
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "membership_type", Type: field.TypeString, Default: "normal"},
{Name: "collection_id", Type: field.TypeString, Size: 20},
{Name: "node_id", Type: field.TypeString, Size: 20},
}
// CollectionNodesTable holds the schema information for the "collection_nodes" table.
CollectionNodesTable = &schema.Table{
Name: "collection_nodes",
Columns: CollectionNodesColumns,
PrimaryKey: []*schema.Column{CollectionNodesColumns[2], CollectionNodesColumns[3]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "collection_nodes_collections_collection",
Columns: []*schema.Column{CollectionNodesColumns[2]},
RefColumns: []*schema.Column{CollectionsColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "collection_nodes_nodes_node",
Columns: []*schema.Column{CollectionNodesColumns[3]},
RefColumns: []*schema.Column{NodesColumns[0]},
OnDelete: schema.Cascade,
},
},
Indexes: []*schema.Index{
{
Name: "unique_collection_node",
Unique: true,
Columns: []*schema.Column{CollectionNodesColumns[2], CollectionNodesColumns[3]},
},
},
}
// CollectionPostsColumns holds the columns for the "collection_posts" table.
CollectionPostsColumns = []*schema.Column{
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "membership_type", Type: field.TypeString, Default: "normal"},
{Name: "collection_id", Type: field.TypeString, Size: 20},
{Name: "post_id", Type: field.TypeString, Size: 20},
}
// CollectionPostsTable holds the schema information for the "collection_posts" table.
CollectionPostsTable = &schema.Table{
Name: "collection_posts",
Columns: CollectionPostsColumns,
PrimaryKey: []*schema.Column{CollectionPostsColumns[2], CollectionPostsColumns[3]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "collection_posts_collections_collection",
Columns: []*schema.Column{CollectionPostsColumns[2]},
RefColumns: []*schema.Column{CollectionsColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "collection_posts_posts_post",
Columns: []*schema.Column{CollectionPostsColumns[3]},
RefColumns: []*schema.Column{PostsColumns[0]},
OnDelete: schema.Cascade,
},
},
Indexes: []*schema.Index{
{
Name: "unique_collection_post",
Unique: true,
Columns: []*schema.Column{CollectionPostsColumns[2], CollectionPostsColumns[3]},
},
},
}
// EmailsColumns holds the columns for the "emails" table.
EmailsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "email_address", Type: field.TypeString, Unique: true, Size: 254},
{Name: "verification_code", Type: field.TypeString, Size: 6},
{Name: "verified", Type: field.TypeBool, Default: "false"},
{Name: "account_id", Type: field.TypeString, Nullable: true, Size: 20},
}
// EmailsTable holds the schema information for the "emails" table.
EmailsTable = &schema.Table{
Name: "emails",
Columns: EmailsColumns,
PrimaryKey: []*schema.Column{EmailsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "emails_accounts_emails",
Columns: []*schema.Column{EmailsColumns[5]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.Cascade,
},
},
}
// EventsColumns holds the columns for the "events" table.
EventsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "updated_at", Type: field.TypeTime},
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
{Name: "indexed_at", Type: field.TypeTime, Nullable: true},
{Name: "name", Type: field.TypeString},
{Name: "slug", Type: field.TypeString, Unique: true},
{Name: "description", Type: field.TypeString, Nullable: true},
{Name: "start_time", Type: field.TypeTime},
{Name: "end_time", Type: field.TypeTime},
{Name: "participation_policy", Type: field.TypeString},
{Name: "visibility", Type: field.TypeEnum, Enums: []string{"draft", "unlisted", "review", "published"}, Default: "draft"},
{Name: "location_type", Type: field.TypeString, Nullable: true},
{Name: "location_name", Type: field.TypeString, Nullable: true},
{Name: "location_address", Type: field.TypeString, Nullable: true},
{Name: "location_latitude", Type: field.TypeFloat64, Nullable: true},
{Name: "location_longitude", Type: field.TypeFloat64, Nullable: true},
{Name: "location_url", Type: field.TypeString, Nullable: true},
{Name: "capacity", Type: field.TypeInt, Nullable: true},
{Name: "metadata", Type: field.TypeJSON, Nullable: true},
{Name: "asset_event", Type: field.TypeString, Nullable: true, Size: 20},
{Name: "post_event", Type: field.TypeString, Size: 20},
}
// EventsTable holds the schema information for the "events" table.
EventsTable = &schema.Table{
Name: "events",
Columns: EventsColumns,
PrimaryKey: []*schema.Column{EventsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "events_assets_event",
Columns: []*schema.Column{EventsColumns[20]},
RefColumns: []*schema.Column{AssetsColumns[0]},
OnDelete: schema.SetNull,
},
{
Symbol: "events_posts_event",
Columns: []*schema.Column{EventsColumns[21]},
RefColumns: []*schema.Column{PostsColumns[0]},
OnDelete: schema.NoAction,
},
},
Indexes: []*schema.Index{
{
Name: "event_slug",
Unique: true,
Columns: []*schema.Column{EventsColumns[6]},
},
},
}
// EventParticipantsColumns holds the columns for the "event_participants" table.
EventParticipantsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "role", Type: field.TypeString},
{Name: "status", Type: field.TypeString},
{Name: "account_id", Type: field.TypeString, Size: 20},
{Name: "event_id", Type: field.TypeString, Size: 20},
}
// EventParticipantsTable holds the schema information for the "event_participants" table.
EventParticipantsTable = &schema.Table{
Name: "event_participants",
Columns: EventParticipantsColumns,
PrimaryKey: []*schema.Column{EventParticipantsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "event_participants_accounts_events",
Columns: []*schema.Column{EventParticipantsColumns[4]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "event_participants_events_participants",
Columns: []*schema.Column{EventParticipantsColumns[5]},
RefColumns: []*schema.Column{EventsColumns[0]},
OnDelete: schema.Cascade,
},
},
Indexes: []*schema.Index{
{
Name: "unique_event_participant",
Unique: true,
Columns: []*schema.Column{EventParticipantsColumns[4], EventParticipantsColumns[5]},
},
},
}
// InvitationsColumns holds the columns for the "invitations" table.
InvitationsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "updated_at", Type: field.TypeTime},
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
{Name: "message", Type: field.TypeString, Nullable: true},
{Name: "creator_account_id", Type: field.TypeString, Size: 20},
}
// InvitationsTable holds the schema information for the "invitations" table.
InvitationsTable = &schema.Table{
Name: "invitations",
Columns: InvitationsColumns,
PrimaryKey: []*schema.Column{InvitationsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "invitations_accounts_invitations",
Columns: []*schema.Column{InvitationsColumns[5]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.Cascade,
},
},
}
// LikePostsColumns holds the columns for the "like_posts" table.
LikePostsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "account_id", Type: field.TypeString, Size: 20},
{Name: "post_id", Type: field.TypeString, Size: 20},
}
// LikePostsTable holds the schema information for the "like_posts" table.
LikePostsTable = &schema.Table{
Name: "like_posts",
Columns: LikePostsColumns,
PrimaryKey: []*schema.Column{LikePostsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "like_posts_accounts_likes",
Columns: []*schema.Column{LikePostsColumns[2]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "like_posts_posts_likes",
Columns: []*schema.Column{LikePostsColumns[3]},
RefColumns: []*schema.Column{PostsColumns[0]},
OnDelete: schema.Cascade,
},
},
Indexes: []*schema.Index{
{
Name: "unique_like_post",
Unique: true,
Columns: []*schema.Column{LikePostsColumns[2], LikePostsColumns[3]},
},
},
}
// LinksColumns holds the columns for the "links" table.
LinksColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "url", Type: field.TypeString, Unique: true},
{Name: "slug", Type: field.TypeString, Unique: true},
{Name: "domain", Type: field.TypeString},
{Name: "title", Type: field.TypeString},
{Name: "description", Type: field.TypeString},
{Name: "primary_asset_id", Type: field.TypeString, Nullable: true, Size: 20},
{Name: "favicon_asset_id", Type: field.TypeString, Nullable: true, Size: 20},
}
// LinksTable holds the schema information for the "links" table.
LinksTable = &schema.Table{
Name: "links",
Columns: LinksColumns,
PrimaryKey: []*schema.Column{LinksColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "links_assets_primary_image",
Columns: []*schema.Column{LinksColumns[7]},
RefColumns: []*schema.Column{AssetsColumns[0]},
OnDelete: schema.SetNull,
},
{
Symbol: "links_assets_favicon_image",
Columns: []*schema.Column{LinksColumns[8]},
RefColumns: []*schema.Column{AssetsColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// MentionProfilesColumns holds the columns for the "mention_profiles" table.
MentionProfilesColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "account_id", Type: field.TypeString, Size: 20},
{Name: "post_id", Type: field.TypeString, Size: 20},
}
// MentionProfilesTable holds the schema information for the "mention_profiles" table.
MentionProfilesTable = &schema.Table{
Name: "mention_profiles",
Columns: MentionProfilesColumns,
PrimaryKey: []*schema.Column{MentionProfilesColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "mention_profiles_accounts_mentions",
Columns: []*schema.Column{MentionProfilesColumns[2]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "mention_profiles_posts_mentions",
Columns: []*schema.Column{MentionProfilesColumns[3]},
RefColumns: []*schema.Column{PostsColumns[0]},
OnDelete: schema.Cascade,
},
},
Indexes: []*schema.Index{
{
Name: "unique_mentions_post",
Unique: true,
Columns: []*schema.Column{MentionProfilesColumns[2], MentionProfilesColumns[3]},
},
},
}
// NodesColumns holds the columns for the "nodes" table.
NodesColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "updated_at", Type: field.TypeTime},
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
{Name: "indexed_at", Type: field.TypeTime, Nullable: true},
{Name: "name", Type: field.TypeString},
{Name: "slug", Type: field.TypeString, Unique: true},
{Name: "description", Type: field.TypeString, Nullable: true},
{Name: "content", Type: field.TypeString, Nullable: true},
{Name: "hide_child_tree", Type: field.TypeBool, Default: map[string]schema.Expr{"postgres": "false", "sqlite3": "0"}},
{Name: "visibility", Type: field.TypeEnum, Enums: []string{"draft", "unlisted", "review", "published"}, Default: "draft"},
{Name: "sort", Type: field.TypeString},
{Name: "metadata", Type: field.TypeJSON, Nullable: true},
{Name: "account_id", Type: field.TypeString, Size: 20},
{Name: "link_id", Type: field.TypeString, Nullable: true, Size: 20},
{Name: "parent_node_id", Type: field.TypeString, Nullable: true, Size: 20},
{Name: "primary_asset_id", Type: field.TypeString, Nullable: true, Size: 20},
{Name: "property_schema_id", Type: field.TypeString, Nullable: true, Size: 20},
}
// NodesTable holds the schema information for the "nodes" table.
NodesTable = &schema.Table{
Name: "nodes",
Columns: NodesColumns,
PrimaryKey: []*schema.Column{NodesColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "nodes_accounts_nodes",
Columns: []*schema.Column{NodesColumns[13]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "nodes_links_nodes",
Columns: []*schema.Column{NodesColumns[14]},
RefColumns: []*schema.Column{LinksColumns[0]},
OnDelete: schema.SetNull,
},
{
Symbol: "nodes_nodes_nodes",
Columns: []*schema.Column{NodesColumns[15]},
RefColumns: []*schema.Column{NodesColumns[0]},
OnDelete: schema.SetNull,
},
{
Symbol: "nodes_assets_primary_image",
Columns: []*schema.Column{NodesColumns[16]},
RefColumns: []*schema.Column{AssetsColumns[0]},
OnDelete: schema.SetNull,
},
{
Symbol: "nodes_property_schemas_node",
Columns: []*schema.Column{NodesColumns[17]},
RefColumns: []*schema.Column{PropertySchemasColumns[0]},
OnDelete: schema.SetNull,
},
},
Indexes: []*schema.Index{
{
Name: "node_slug",
Unique: false,
Columns: []*schema.Column{NodesColumns[6]},
},
},
}
// NotificationsColumns holds the columns for the "notifications" table.
NotificationsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
{Name: "event_type", Type: field.TypeString},
{Name: "datagraph_kind", Type: field.TypeString, Nullable: true},
{Name: "datagraph_id", Type: field.TypeString, Nullable: true},
{Name: "read", Type: field.TypeBool},
{Name: "owner_account_id", Type: field.TypeString, Size: 20},
{Name: "source_account_id", Type: field.TypeString, Nullable: true, Size: 20},
}
// NotificationsTable holds the schema information for the "notifications" table.
NotificationsTable = &schema.Table{
Name: "notifications",
Columns: NotificationsColumns,
PrimaryKey: []*schema.Column{NotificationsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "notifications_accounts_notifications",
Columns: []*schema.Column{NotificationsColumns[7]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "notifications_accounts_triggered_notifications",
Columns: []*schema.Column{NotificationsColumns[8]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.Cascade,
},
},
}
// PostsColumns holds the columns for the "posts" table.
PostsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "updated_at", Type: field.TypeTime},
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
{Name: "indexed_at", Type: field.TypeTime, Nullable: true},
{Name: "first", Type: field.TypeBool},
{Name: "title", Type: field.TypeString, Nullable: true},
{Name: "slug", Type: field.TypeString, Nullable: true},
{Name: "pinned", Type: field.TypeBool, Default: false},
{Name: "last_reply_at", Type: field.TypeTime, Nullable: true},
{Name: "body", Type: field.TypeString},
{Name: "short", Type: field.TypeString},
{Name: "metadata", Type: field.TypeJSON, Nullable: true},
{Name: "visibility", Type: field.TypeEnum, Enums: []string{"draft", "unlisted", "review", "published"}, Default: "draft"},
{Name: "account_posts", Type: field.TypeString, Size: 20},
{Name: "category_id", Type: field.TypeString, Nullable: true, Size: 20},
{Name: "link_id", Type: field.TypeString, Nullable: true, Size: 20},
{Name: "root_post_id", Type: field.TypeString, Nullable: true, Size: 20},
{Name: "reply_to_post_id", Type: field.TypeString, Nullable: true, Size: 20},
}
// PostsTable holds the schema information for the "posts" table.
PostsTable = &schema.Table{
Name: "posts",
Columns: PostsColumns,
PrimaryKey: []*schema.Column{PostsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "posts_accounts_posts",
Columns: []*schema.Column{PostsColumns[14]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.NoAction,
},
{
Symbol: "posts_categories_posts",
Columns: []*schema.Column{PostsColumns[15]},
RefColumns: []*schema.Column{CategoriesColumns[0]},
OnDelete: schema.SetNull,
},
{
Symbol: "posts_links_posts",
Columns: []*schema.Column{PostsColumns[16]},
RefColumns: []*schema.Column{LinksColumns[0]},
OnDelete: schema.SetNull,
},
{
Symbol: "posts_posts_posts",
Columns: []*schema.Column{PostsColumns[17]},
RefColumns: []*schema.Column{PostsColumns[0]},
OnDelete: schema.SetNull,
},
{
Symbol: "posts_posts_replies",
Columns: []*schema.Column{PostsColumns[18]},
RefColumns: []*schema.Column{PostsColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// PostReadsColumns holds the columns for the "post_reads" table.
PostReadsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "last_seen_at", Type: field.TypeTime},
{Name: "account_id", Type: field.TypeString, Size: 20},
{Name: "root_post_id", Type: field.TypeString, Size: 20},
}
// PostReadsTable holds the schema information for the "post_reads" table.
PostReadsTable = &schema.Table{
Name: "post_reads",
Columns: PostReadsColumns,
PrimaryKey: []*schema.Column{PostReadsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "post_reads_accounts_post_reads",
Columns: []*schema.Column{PostReadsColumns[2]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "post_reads_posts_post_reads",
Columns: []*schema.Column{PostReadsColumns[3]},
RefColumns: []*schema.Column{PostsColumns[0]},
OnDelete: schema.Cascade,
},
},
Indexes: []*schema.Index{
{
Name: "unique_post_read",
Unique: true,
Columns: []*schema.Column{PostReadsColumns[3], PostReadsColumns[2]},
},
},
}
// PropertiesColumns holds the columns for the "properties" table.
PropertiesColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "value", Type: field.TypeString},
{Name: "node_id", Type: field.TypeString, Size: 20},
{Name: "field_id", Type: field.TypeString, Size: 20},
}
// PropertiesTable holds the schema information for the "properties" table.
PropertiesTable = &schema.Table{
Name: "properties",
Columns: PropertiesColumns,
PrimaryKey: []*schema.Column{PropertiesColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "properties_nodes_properties",
Columns: []*schema.Column{PropertiesColumns[3]},
RefColumns: []*schema.Column{NodesColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "properties_property_schema_fields_properties",
Columns: []*schema.Column{PropertiesColumns[4]},
RefColumns: []*schema.Column{PropertySchemaFieldsColumns[0]},
OnDelete: schema.Cascade,
},
},
Indexes: []*schema.Index{
{
Name: "property_field_id_node_id",
Unique: true,
Columns: []*schema.Column{PropertiesColumns[4], PropertiesColumns[3]},
},
{
Name: "property_field_id",
Unique: false,
Columns: []*schema.Column{PropertiesColumns[4]},
},
{
Name: "property_node_id",
Unique: false,
Columns: []*schema.Column{PropertiesColumns[3]},
},
},
}
// PropertySchemasColumns holds the columns for the "property_schemas" table.
PropertySchemasColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
}
// PropertySchemasTable holds the schema information for the "property_schemas" table.
PropertySchemasTable = &schema.Table{
Name: "property_schemas",
Columns: PropertySchemasColumns,
PrimaryKey: []*schema.Column{PropertySchemasColumns[0]},
}
// PropertySchemaFieldsColumns holds the columns for the "property_schema_fields" table.
PropertySchemaFieldsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "name", Type: field.TypeString},
{Name: "type", Type: field.TypeString},
{Name: "sort", Type: field.TypeString},
{Name: "schema_id", Type: field.TypeString, Size: 20},
}
// PropertySchemaFieldsTable holds the schema information for the "property_schema_fields" table.
PropertySchemaFieldsTable = &schema.Table{
Name: "property_schema_fields",
Columns: PropertySchemaFieldsColumns,
PrimaryKey: []*schema.Column{PropertySchemaFieldsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "property_schema_fields_property_schemas_fields",
Columns: []*schema.Column{PropertySchemaFieldsColumns[4]},
RefColumns: []*schema.Column{PropertySchemasColumns[0]},
OnDelete: schema.Cascade,
},
},
Indexes: []*schema.Index{
{
Name: "propertyschemafield_schema_id_name",
Unique: true,
Columns: []*schema.Column{PropertySchemaFieldsColumns[4], PropertySchemaFieldsColumns[1]},
},
{
Name: "propertyschemafield_name",
Unique: false,
Columns: []*schema.Column{PropertySchemaFieldsColumns[1]},
},
},
}
// QuestionsColumns holds the columns for the "questions" table.
QuestionsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "indexed_at", Type: field.TypeTime, Nullable: true},
{Name: "slug", Type: field.TypeString, Unique: true},
{Name: "query", Type: field.TypeString},
{Name: "result", Type: field.TypeString},
{Name: "metadata", Type: field.TypeJSON, Nullable: true},
{Name: "account_id", Type: field.TypeString, Nullable: true, Size: 20},
{Name: "parent_question_id", Type: field.TypeString, Nullable: true, Size: 20},
}
// QuestionsTable holds the schema information for the "questions" table.
QuestionsTable = &schema.Table{
Name: "questions",
Columns: QuestionsColumns,
PrimaryKey: []*schema.Column{QuestionsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "questions_accounts_questions",
Columns: []*schema.Column{QuestionsColumns[7]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.SetNull,
},
{
Symbol: "questions_questions_parent_question",
Columns: []*schema.Column{QuestionsColumns[8]},
RefColumns: []*schema.Column{QuestionsColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// ReactsColumns holds the columns for the "reacts" table.
ReactsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "emoji", Type: field.TypeString},
{Name: "account_id", Type: field.TypeString, Size: 20},
{Name: "post_id", Type: field.TypeString, Size: 20},
}
// ReactsTable holds the schema information for the "reacts" table.
ReactsTable = &schema.Table{
Name: "reacts",
Columns: ReactsColumns,
PrimaryKey: []*schema.Column{ReactsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "reacts_accounts_reacts",
Columns: []*schema.Column{ReactsColumns[3]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "reacts_posts_reacts",
Columns: []*schema.Column{ReactsColumns[4]},
RefColumns: []*schema.Column{PostsColumns[0]},
OnDelete: schema.Cascade,
},
},
Indexes: []*schema.Index{
{
Name: "unique_react_post_emoji",
Unique: true,
Columns: []*schema.Column{ReactsColumns[3], ReactsColumns[4], ReactsColumns[2]},
},
},
}
// ReportsColumns holds the columns for the "reports" table.
ReportsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "updated_at", Type: field.TypeTime},
{Name: "target_id", Type: field.TypeString},
{Name: "target_kind", Type: field.TypeString},
{Name: "comment", Type: field.TypeString, Nullable: true, Size: 2147483647},
{Name: "reason", Type: field.TypeString, Nullable: true},
{Name: "status", Type: field.TypeString, Default: "submitted"},
{Name: "reported_by_id", Type: field.TypeString, Size: 20},
{Name: "handled_by_id", Type: field.TypeString, Nullable: true, Size: 20},
}
// ReportsTable holds the schema information for the "reports" table.
ReportsTable = &schema.Table{
Name: "reports",
Columns: ReportsColumns,
PrimaryKey: []*schema.Column{ReportsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "reports_accounts_reports",
Columns: []*schema.Column{ReportsColumns[8]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "reports_accounts_handled_reports",
Columns: []*schema.Column{ReportsColumns[9]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// RolesColumns holds the columns for the "roles" table.
RolesColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "updated_at", Type: field.TypeTime},
{Name: "name", Type: field.TypeString, Unique: true},
{Name: "colour", Type: field.TypeString, Default: "hsl(157, 65%, 44%)"},
{Name: "permissions", Type: field.TypeJSON},
{Name: "sort_key", Type: field.TypeFloat64, Default: "0.0"},
}
// RolesTable holds the schema information for the "roles" table.
RolesTable = &schema.Table{
Name: "roles",
Columns: RolesColumns,
PrimaryKey: []*schema.Column{RolesColumns[0]},
}
// SessionsColumns holds the columns for the "sessions" table.
SessionsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "expires_at", Type: field.TypeTime},
{Name: "revoked_at", Type: field.TypeTime, Nullable: true},
{Name: "account_id", Type: field.TypeString, Size: 20},
}
// SessionsTable holds the schema information for the "sessions" table.
SessionsTable = &schema.Table{
Name: "sessions",
Columns: SessionsColumns,
PrimaryKey: []*schema.Column{SessionsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "sessions_accounts_sessions",
Columns: []*schema.Column{SessionsColumns[4]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.Cascade,
},
},
}
// SettingsColumns holds the columns for the "settings" table.
SettingsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Unique: true},
{Name: "value", Type: field.TypeString},
{Name: "updated_at", Type: field.TypeTime},
}
// SettingsTable holds the schema information for the "settings" table.
SettingsTable = &schema.Table{
Name: "settings",
Columns: SettingsColumns,
PrimaryKey: []*schema.Column{SettingsColumns[0]},
}
// TagsColumns holds the columns for the "tags" table.
TagsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Size: 20},
{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"},
{Name: "name", Type: field.TypeString, Unique: true},
}
// TagsTable holds the schema information for the "tags" table.
TagsTable = &schema.Table{
Name: "tags",
Columns: TagsColumns,
PrimaryKey: []*schema.Column{TagsColumns[0]},
}
// AccountTagsColumns holds the columns for the "account_tags" table.
AccountTagsColumns = []*schema.Column{
{Name: "account_id", Type: field.TypeString, Size: 20},
{Name: "tag_id", Type: field.TypeString, Size: 20},
}
// AccountTagsTable holds the schema information for the "account_tags" table.
AccountTagsTable = &schema.Table{
Name: "account_tags",
Columns: AccountTagsColumns,
PrimaryKey: []*schema.Column{AccountTagsColumns[0], AccountTagsColumns[1]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "account_tags_account_id",
Columns: []*schema.Column{AccountTagsColumns[0]},
RefColumns: []*schema.Column{AccountsColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "account_tags_tag_id",
Columns: []*schema.Column{AccountTagsColumns[1]},
RefColumns: []*schema.Column{TagsColumns[0]},
OnDelete: schema.Cascade,
},
},
}
// LinkPostContentReferencesColumns holds the columns for the "link_post_content_references" table.
LinkPostContentReferencesColumns = []*schema.Column{
{Name: "link_id", Type: field.TypeString, Size: 20},
{Name: "post_id", Type: field.TypeString, Size: 20},
}
// LinkPostContentReferencesTable holds the schema information for the "link_post_content_references" table.
LinkPostContentReferencesTable = &schema.Table{
Name: "link_post_content_references",
Columns: LinkPostContentReferencesColumns,
PrimaryKey: []*schema.Column{LinkPostContentReferencesColumns[0], LinkPostContentReferencesColumns[1]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "link_post_content_references_link_id",
Columns: []*schema.Column{LinkPostContentReferencesColumns[0]},
RefColumns: []*schema.Column{LinksColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "link_post_content_references_post_id",
Columns: []*schema.Column{LinkPostContentReferencesColumns[1]},
RefColumns: []*schema.Column{PostsColumns[0]},
OnDelete: schema.Cascade,
},
},
}
// LinkNodeContentReferencesColumns holds the columns for the "link_node_content_references" table.
LinkNodeContentReferencesColumns = []*schema.Column{
{Name: "link_id", Type: field.TypeString, Size: 20},
{Name: "node_id", Type: field.TypeString, Size: 20},
}
// LinkNodeContentReferencesTable holds the schema information for the "link_node_content_references" table.
LinkNodeContentReferencesTable = &schema.Table{
Name: "link_node_content_references",
Columns: LinkNodeContentReferencesColumns,
PrimaryKey: []*schema.Column{LinkNodeContentReferencesColumns[0], LinkNodeContentReferencesColumns[1]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "link_node_content_references_link_id",
Columns: []*schema.Column{LinkNodeContentReferencesColumns[0]},
RefColumns: []*schema.Column{LinksColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "link_node_content_references_node_id",
Columns: []*schema.Column{LinkNodeContentReferencesColumns[1]},
RefColumns: []*schema.Column{NodesColumns[0]},
OnDelete: schema.Cascade,
},
},
}
// LinkAssetsColumns holds the columns for the "link_assets" table.
LinkAssetsColumns = []*schema.Column{
{Name: "link_id", Type: field.TypeString, Size: 20},
{Name: "asset_id", Type: field.TypeString, Size: 20},
}
// LinkAssetsTable holds the schema information for the "link_assets" table.
LinkAssetsTable = &schema.Table{
Name: "link_assets",
Columns: LinkAssetsColumns,
PrimaryKey: []*schema.Column{LinkAssetsColumns[0], LinkAssetsColumns[1]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "link_assets_link_id",
Columns: []*schema.Column{LinkAssetsColumns[0]},
RefColumns: []*schema.Column{LinksColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "link_assets_asset_id",
Columns: []*schema.Column{LinkAssetsColumns[1]},
RefColumns: []*schema.Column{AssetsColumns[0]},
OnDelete: schema.Cascade,
},
},
}
// NodeAssetsColumns holds the columns for the "node_assets" table.
NodeAssetsColumns = []*schema.Column{
{Name: "node_id", Type: field.TypeString, Size: 20},
{Name: "asset_id", Type: field.TypeString, Size: 20},
}
// NodeAssetsTable holds the schema information for the "node_assets" table.
NodeAssetsTable = &schema.Table{
Name: "node_assets",
Columns: NodeAssetsColumns,
PrimaryKey: []*schema.Column{NodeAssetsColumns[0], NodeAssetsColumns[1]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "node_assets_node_id",
Columns: []*schema.Column{NodeAssetsColumns[0]},
RefColumns: []*schema.Column{NodesColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "node_assets_asset_id",
Columns: []*schema.Column{NodeAssetsColumns[1]},
RefColumns: []*schema.Column{AssetsColumns[0]},
OnDelete: schema.Cascade,
},
},
}
// PostAssetsColumns holds the columns for the "post_assets" table.
PostAssetsColumns = []*schema.Column{
{Name: "post_id", Type: field.TypeString, Size: 20},
{Name: "asset_id", Type: field.TypeString, Size: 20},
}
// PostAssetsTable holds the schema information for the "post_assets" table.
PostAssetsTable = &schema.Table{
Name: "post_assets",
Columns: PostAssetsColumns,
PrimaryKey: []*schema.Column{PostAssetsColumns[0], PostAssetsColumns[1]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "post_assets_post_id",
Columns: []*schema.Column{PostAssetsColumns[0]},
RefColumns: []*schema.Column{PostsColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "post_assets_asset_id",
Columns: []*schema.Column{PostAssetsColumns[1]},
RefColumns: []*schema.Column{AssetsColumns[0]},
OnDelete: schema.Cascade,
},
},
}
// TagPostsColumns holds the columns for the "tag_posts" table.
TagPostsColumns = []*schema.Column{
{Name: "tag_id", Type: field.TypeString, Size: 20},
{Name: "post_id", Type: field.TypeString, Size: 20},
}
// TagPostsTable holds the schema information for the "tag_posts" table.
TagPostsTable = &schema.Table{
Name: "tag_posts",
Columns: TagPostsColumns,
PrimaryKey: []*schema.Column{TagPostsColumns[0], TagPostsColumns[1]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "tag_posts_tag_id",
Columns: []*schema.Column{TagPostsColumns[0]},
RefColumns: []*schema.Column{TagsColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "tag_posts_post_id",
Columns: []*schema.Column{TagPostsColumns[1]},
RefColumns: []*schema.Column{PostsColumns[0]},
OnDelete: schema.Cascade,
},
},
}
// TagNodesColumns holds the columns for the "tag_nodes" table.
TagNodesColumns = []*schema.Column{
{Name: "tag_id", Type: field.TypeString, Size: 20},
{Name: "node_id", Type: field.TypeString, Size: 20},
}
// TagNodesTable holds the schema information for the "tag_nodes" table.
TagNodesTable = &schema.Table{
Name: "tag_nodes",
Columns: TagNodesColumns,
PrimaryKey: []*schema.Column{TagNodesColumns[0], TagNodesColumns[1]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "tag_nodes_tag_id",
Columns: []*schema.Column{TagNodesColumns[0]},
RefColumns: []*schema.Column{TagsColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "tag_nodes_node_id",
Columns: []*schema.Column{TagNodesColumns[1]},
RefColumns: []*schema.Column{NodesColumns[0]},
OnDelete: schema.Cascade,
},
},
}
// Tables holds all the tables in the schema.
Tables = []*schema.Table{
AccountsTable,
AccountFollowsTable,
AccountRolesTable,
AssetsTable,
AuthenticationsTable,
CategoriesTable,
CollectionsTable,
CollectionNodesTable,
CollectionPostsTable,
EmailsTable,
EventsTable,
EventParticipantsTable,
InvitationsTable,
LikePostsTable,
LinksTable,
MentionProfilesTable,
NodesTable,
NotificationsTable,
PostsTable,
PostReadsTable,
PropertiesTable,
PropertySchemasTable,
PropertySchemaFieldsTable,
QuestionsTable,
ReactsTable,
ReportsTable,
RolesTable,
SessionsTable,
SettingsTable,
TagsTable,
AccountTagsTable,
LinkPostContentReferencesTable,
LinkNodeContentReferencesTable,
LinkAssetsTable,
NodeAssetsTable,
PostAssetsTable,
TagPostsTable,
TagNodesTable,
}
)
func init() {
AccountsTable.ForeignKeys[0].RefTable = InvitationsTable
AccountFollowsTable.ForeignKeys[0].RefTable = AccountsTable
AccountFollowsTable.ForeignKeys[1].RefTable = AccountsTable
AccountRolesTable.ForeignKeys[0].RefTable = AccountsTable
AccountRolesTable.ForeignKeys[1].RefTable = RolesTable
AssetsTable.ForeignKeys[0].RefTable = AccountsTable
AssetsTable.ForeignKeys[1].RefTable = AssetsTable
AuthenticationsTable.ForeignKeys[0].RefTable = AccountsTable
CategoriesTable.ForeignKeys[0].RefTable = CategoriesTable
CategoriesTable.ForeignKeys[1].RefTable = AssetsTable
CollectionsTable.ForeignKeys[0].RefTable = AccountsTable
CollectionsTable.ForeignKeys[1].RefTable = AssetsTable
CollectionNodesTable.ForeignKeys[0].RefTable = CollectionsTable
CollectionNodesTable.ForeignKeys[1].RefTable = NodesTable
CollectionPostsTable.ForeignKeys[0].RefTable = CollectionsTable
CollectionPostsTable.ForeignKeys[1].RefTable = PostsTable
EmailsTable.ForeignKeys[0].RefTable = AccountsTable
EventsTable.ForeignKeys[0].RefTable = AssetsTable
EventsTable.ForeignKeys[1].RefTable = PostsTable
EventParticipantsTable.ForeignKeys[0].RefTable = AccountsTable
EventParticipantsTable.ForeignKeys[1].RefTable = EventsTable
InvitationsTable.ForeignKeys[0].RefTable = AccountsTable
LikePostsTable.ForeignKeys[0].RefTable = AccountsTable
LikePostsTable.ForeignKeys[1].RefTable = PostsTable
LinksTable.ForeignKeys[0].RefTable = AssetsTable
LinksTable.ForeignKeys[1].RefTable = AssetsTable
MentionProfilesTable.ForeignKeys[0].RefTable = AccountsTable
MentionProfilesTable.ForeignKeys[1].RefTable = PostsTable
NodesTable.ForeignKeys[0].RefTable = AccountsTable
NodesTable.ForeignKeys[1].RefTable = LinksTable
NodesTable.ForeignKeys[2].RefTable = NodesTable
NodesTable.ForeignKeys[3].RefTable = AssetsTable
NodesTable.ForeignKeys[4].RefTable = PropertySchemasTable
NotificationsTable.ForeignKeys[0].RefTable = AccountsTable
NotificationsTable.ForeignKeys[1].RefTable = AccountsTable
PostsTable.ForeignKeys[0].RefTable = AccountsTable
PostsTable.ForeignKeys[1].RefTable = CategoriesTable
PostsTable.ForeignKeys[2].RefTable = LinksTable
PostsTable.ForeignKeys[3].RefTable = PostsTable
PostsTable.ForeignKeys[4].RefTable = PostsTable
PostReadsTable.ForeignKeys[0].RefTable = AccountsTable
PostReadsTable.ForeignKeys[1].RefTable = PostsTable
PropertiesTable.ForeignKeys[0].RefTable = NodesTable
PropertiesTable.ForeignKeys[1].RefTable = PropertySchemaFieldsTable
PropertySchemaFieldsTable.ForeignKeys[0].RefTable = PropertySchemasTable
QuestionsTable.ForeignKeys[0].RefTable = AccountsTable
QuestionsTable.ForeignKeys[1].RefTable = QuestionsTable
ReactsTable.ForeignKeys[0].RefTable = AccountsTable
ReactsTable.ForeignKeys[1].RefTable = PostsTable
ReportsTable.ForeignKeys[0].RefTable = AccountsTable
ReportsTable.ForeignKeys[1].RefTable = AccountsTable
SessionsTable.ForeignKeys[0].RefTable = AccountsTable
AccountTagsTable.ForeignKeys[0].RefTable = AccountsTable
AccountTagsTable.ForeignKeys[1].RefTable = TagsTable
LinkPostContentReferencesTable.ForeignKeys[0].RefTable = LinksTable
LinkPostContentReferencesTable.ForeignKeys[1].RefTable = PostsTable
LinkNodeContentReferencesTable.ForeignKeys[0].RefTable = LinksTable
LinkNodeContentReferencesTable.ForeignKeys[1].RefTable = NodesTable
LinkAssetsTable.ForeignKeys[0].RefTable = LinksTable
LinkAssetsTable.ForeignKeys[1].RefTable = AssetsTable
NodeAssetsTable.ForeignKeys[0].RefTable = NodesTable
NodeAssetsTable.ForeignKeys[1].RefTable = AssetsTable
PostAssetsTable.ForeignKeys[0].RefTable = PostsTable
PostAssetsTable.ForeignKeys[1].RefTable = AssetsTable
TagPostsTable.ForeignKeys[0].RefTable = TagsTable
TagPostsTable.ForeignKeys[1].RefTable = PostsTable
TagNodesTable.ForeignKeys[0].RefTable = TagsTable
TagNodesTable.ForeignKeys[1].RefTable = NodesTable
}