// Code generated by ent, DO NOT EDIT.

package migrate

import (
	"entgo.io/ent/dialect/sql/schema"
	"entgo.io/ent/schema/field"
)

var (
	// AlbumsColumns holds the columns for the "albums" table.
	AlbumsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint, Increment: true},
		{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "image_url", Type: field.TypeString, Size: 255},
		{Name: "big_image_url", Type: field.TypeString, Nullable: true, Size: 255},
		{Name: "download_url", Type: field.TypeString, Nullable: true, Size: 255},
		{Name: "thumb_param", Type: field.TypeString, Nullable: true, Size: 512},
		{Name: "big_param", Type: field.TypeString, Nullable: true, Size: 512},
		{Name: "tags", Type: field.TypeString, Nullable: true, Size: 255},
		{Name: "view_count", Type: field.TypeInt, Default: 0},
		{Name: "download_count", Type: field.TypeInt, Default: 0},
		{Name: "width", Type: field.TypeInt, Nullable: true},
		{Name: "height", Type: field.TypeInt, Nullable: true},
		{Name: "file_size", Type: field.TypeInt64, Nullable: true},
		{Name: "format", Type: field.TypeString, Nullable: true, Size: 50},
		{Name: "aspect_ratio", Type: field.TypeString, Nullable: true, Size: 50},
		{Name: "file_hash", Type: field.TypeString, Unique: true, Size: 64},
		{Name: "display_order", Type: field.TypeInt, Default: 0},
	}
	// AlbumsTable holds the schema information for the "albums" table.
	AlbumsTable = &schema.Table{
		Name:       "albums",
		Columns:    AlbumsColumns,
		PrimaryKey: []*schema.Column{AlbumsColumns[0]},
	}
	// ArticlesColumns holds the columns for the "articles" table.
	ArticlesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint, Increment: true},
		{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "title", Type: field.TypeString},
		{Name: "content_md", Type: field.TypeString, Nullable: true, Size: 2147483647},
		{Name: "content_html", Type: field.TypeString, Nullable: true, Size: 2147483647},
		{Name: "cover_url", Type: field.TypeString, Nullable: true},
		{Name: "status", Type: field.TypeEnum, Enums: []string{"DRAFT", "PUBLISHED", "ARCHIVED"}, Default: "DRAFT"},
		{Name: "view_count", Type: field.TypeInt, Default: 0},
		{Name: "word_count", Type: field.TypeInt, Default: 0},
		{Name: "reading_time", Type: field.TypeInt, Default: 0},
		{Name: "ip_location", Type: field.TypeString, Nullable: true},
		{Name: "primary_color", Type: field.TypeString, Nullable: true, Default: "#b4bfe2"},
		{Name: "is_primary_color_manual", Type: field.TypeBool, Default: false},
		{Name: "home_sort", Type: field.TypeInt, Default: 0},
		{Name: "pin_sort", Type: field.TypeInt, Default: 0},
		{Name: "top_img_url", Type: field.TypeString, Nullable: true},
		{Name: "summaries", Type: field.TypeJSON, Nullable: true},
		{Name: "abbrlink", Type: field.TypeString, Unique: true, Nullable: true},
		{Name: "copyright", Type: field.TypeBool, Default: true},
		{Name: "copyright_author", Type: field.TypeString, Nullable: true},
		{Name: "copyright_author_href", Type: field.TypeString, Nullable: true},
		{Name: "copyright_url", Type: field.TypeString, Nullable: true},
	}
	// ArticlesTable holds the schema information for the "articles" table.
	ArticlesTable = &schema.Table{
		Name:       "articles",
		Columns:    ArticlesColumns,
		PrimaryKey: []*schema.Column{ArticlesColumns[0]},
	}
	// CommentsColumns holds the columns for the "comments" table.
	CommentsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint, Increment: true},
		{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "target_path", Type: field.TypeString, Size: 255},
		{Name: "target_title", Type: field.TypeString, Nullable: true, Size: 255},
		{Name: "nickname", Type: field.TypeString, Size: 50},
		{Name: "email", Type: field.TypeString, Nullable: true, Size: 100},
		{Name: "email_md5", Type: field.TypeString, Size: 32},
		{Name: "website", Type: field.TypeString, Nullable: true, Size: 255},
		{Name: "content", Type: field.TypeString, Size: 2147483647},
		{Name: "content_html", Type: field.TypeString, Size: 2147483647},
		{Name: "status", Type: field.TypeInt, Default: 2},
		{Name: "is_admin_comment", Type: field.TypeBool, Default: false},
		{Name: "is_anonymous", Type: field.TypeBool, Default: false},
		{Name: "allow_notification", Type: field.TypeBool, Default: true},
		{Name: "user_agent", Type: field.TypeString, Nullable: true, Size: 512},
		{Name: "ip_address", Type: field.TypeString, Size: 45},
		{Name: "ip_location", Type: field.TypeString, Nullable: true, Size: 255},
		{Name: "like_count", Type: field.TypeInt, Default: 0},
		{Name: "pinned_at", Type: field.TypeTime, Nullable: true},
		{Name: "article_comments", Type: field.TypeUint, Nullable: true},
		{Name: "parent_id", Type: field.TypeUint, Nullable: true},
		{Name: "user_id", Type: field.TypeUint, Nullable: true},
	}
	// CommentsTable holds the schema information for the "comments" table.
	CommentsTable = &schema.Table{
		Name:       "comments",
		Columns:    CommentsColumns,
		PrimaryKey: []*schema.Column{CommentsColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "comments_articles_comments",
				Columns:    []*schema.Column{CommentsColumns[21]},
				RefColumns: []*schema.Column{ArticlesColumns[0]},
				OnDelete:   schema.SetNull,
			},
			{
				Symbol:     "comments_comments_parent",
				Columns:    []*schema.Column{CommentsColumns[22]},
				RefColumns: []*schema.Column{CommentsColumns[0]},
				OnDelete:   schema.SetNull,
			},
			{
				Symbol:     "comments_users_comments",
				Columns:    []*schema.Column{CommentsColumns[23]},
				RefColumns: []*schema.Column{UsersColumns[0]},
				OnDelete:   schema.SetNull,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "comment_target_path_status",
				Unique:  false,
				Columns: []*schema.Column{CommentsColumns[4], CommentsColumns[12]},
			},
			{
				Name:    "comment_parent_id",
				Unique:  false,
				Columns: []*schema.Column{CommentsColumns[22]},
			},
			{
				Name:    "comment_user_id",
				Unique:  false,
				Columns: []*schema.Column{CommentsColumns[23]},
			},
			{
				Name:    "comment_email",
				Unique:  false,
				Columns: []*schema.Column{CommentsColumns[7]},
			},
		},
	}
	// DirectLinksColumns holds the columns for the "direct_links" table.
	DirectLinksColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint, Increment: true},
		{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "file_name", Type: field.TypeString, Size: 255},
		{Name: "speed_limit", Type: field.TypeInt64, Default: 0},
		{Name: "downloads", Type: field.TypeInt64, Default: 0},
		{Name: "file_id", Type: field.TypeUint, Unique: true},
	}
	// DirectLinksTable holds the schema information for the "direct_links" table.
	DirectLinksTable = &schema.Table{
		Name:       "direct_links",
		Columns:    DirectLinksColumns,
		PrimaryKey: []*schema.Column{DirectLinksColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "direct_links_files_direct_link",
				Columns:    []*schema.Column{DirectLinksColumns[7]},
				RefColumns: []*schema.Column{FilesColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
	}
	// EntitiesColumns holds the columns for the "entities" table.
	EntitiesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint, Increment: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "type", Type: field.TypeString},
		{Name: "source", Type: field.TypeString, Nullable: true, Size: 2147483647},
		{Name: "size", Type: field.TypeInt64},
		{Name: "upload_session_id", Type: field.TypeString, Nullable: true, Size: 255},
		{Name: "recycle_options", Type: field.TypeString, Nullable: true, Size: 2147483647, SchemaType: map[string]string{"mysql": "json", "postgres": "jsonb", "sqlite3": "text"}},
		{Name: "policy_id", Type: field.TypeUint},
		{Name: "created_by", Type: field.TypeUint64, Nullable: true},
		{Name: "etag", Type: field.TypeString, Nullable: true, Size: 255},
		{Name: "mime_type", Type: field.TypeString, Nullable: true, Size: 100},
		{Name: "dimension", Type: field.TypeString, Nullable: true, Size: 50},
		{Name: "storage_metadata", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"mysql": "json", "postgres": "jsonb", "sqlite3": "text"}},
	}
	// EntitiesTable holds the schema information for the "entities" table.
	EntitiesTable = &schema.Table{
		Name:       "entities",
		Columns:    EntitiesColumns,
		PrimaryKey: []*schema.Column{EntitiesColumns[0]},
	}
	// FilesColumns holds the columns for the "files" table.
	FilesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint, Increment: true},
		{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "type", Type: field.TypeInt},
		{Name: "name", Type: field.TypeString, Size: 255},
		{Name: "size", Type: field.TypeInt64, Default: 0},
		{Name: "children_count", Type: field.TypeInt64, Default: 0},
		{Name: "view_config", Type: field.TypeString, Nullable: true, Size: 2147483647, SchemaType: map[string]string{"mysql": "json", "postgres": "jsonb", "sqlite3": "text"}},
		{Name: "parent_id", Type: field.TypeUint, Nullable: true},
		{Name: "primary_entity_id", Type: field.TypeUint, Nullable: true},
		{Name: "owner_id", Type: field.TypeUint},
	}
	// FilesTable holds the schema information for the "files" table.
	FilesTable = &schema.Table{
		Name:       "files",
		Columns:    FilesColumns,
		PrimaryKey: []*schema.Column{FilesColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "files_files_parent",
				Columns:    []*schema.Column{FilesColumns[9]},
				RefColumns: []*schema.Column{FilesColumns[0]},
				OnDelete:   schema.SetNull,
			},
			{
				Symbol:     "files_entities_primary_entity",
				Columns:    []*schema.Column{FilesColumns[10]},
				RefColumns: []*schema.Column{EntitiesColumns[0]},
				OnDelete:   schema.SetNull,
			},
			{
				Symbol:     "files_users_files",
				Columns:    []*schema.Column{FilesColumns[11]},
				RefColumns: []*schema.Column{UsersColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "file_parent_id_name_owner_id",
				Unique:  true,
				Columns: []*schema.Column{FilesColumns[9], FilesColumns[5], FilesColumns[11]},
			},
		},
	}
	// FileEntitiesColumns holds the columns for the "file_entities" table.
	FileEntitiesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint, Increment: true},
		{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "version", Type: field.TypeString, Nullable: true, Size: 50},
		{Name: "is_current", Type: field.TypeBool, Default: true},
		{Name: "uploaded_by_user_id", Type: field.TypeUint64, Nullable: true},
		{Name: "entity_id", Type: field.TypeUint},
		{Name: "file_id", Type: field.TypeUint},
	}
	// FileEntitiesTable holds the schema information for the "file_entities" table.
	FileEntitiesTable = &schema.Table{
		Name:       "file_entities",
		Columns:    FileEntitiesColumns,
		PrimaryKey: []*schema.Column{FileEntitiesColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "file_entities_entities_file_versions",
				Columns:    []*schema.Column{FileEntitiesColumns[7]},
				RefColumns: []*schema.Column{EntitiesColumns[0]},
				OnDelete:   schema.NoAction,
			},
			{
				Symbol:     "file_entities_files_versions",
				Columns:    []*schema.Column{FileEntitiesColumns[8]},
				RefColumns: []*schema.Column{FilesColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
	}
	// LinksColumns holds the columns for the "links" table.
	LinksColumns = []*schema.Column{
		{Name: "id", Type: field.TypeInt, Increment: true},
		{Name: "name", Type: field.TypeString},
		{Name: "url", Type: field.TypeString},
		{Name: "logo", Type: field.TypeString, Nullable: true},
		{Name: "description", Type: field.TypeString, Nullable: true},
		{Name: "status", Type: field.TypeEnum, Enums: []string{"PENDING", "APPROVED", "REJECTED", "INVALID"}, Default: "PENDING"},
		{Name: "siteshot", Type: field.TypeString, Nullable: true},
		{Name: "sort_order", Type: field.TypeInt, Default: 0},
		{Name: "skip_health_check", Type: field.TypeBool, Default: false},
		{Name: "link_category_links", Type: field.TypeInt},
	}
	// 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_link_categories_links",
				Columns:    []*schema.Column{LinksColumns[9]},
				RefColumns: []*schema.Column{LinkCategoriesColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
	}
	// LinkCategoriesColumns holds the columns for the "link_categories" table.
	LinkCategoriesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeInt, Increment: true},
		{Name: "name", Type: field.TypeString, Unique: true},
		{Name: "description", Type: field.TypeString, Nullable: true},
		{Name: "style", Type: field.TypeEnum, Enums: []string{"card", "list"}, Default: "card"},
	}
	// LinkCategoriesTable holds the schema information for the "link_categories" table.
	LinkCategoriesTable = &schema.Table{
		Name:       "link_categories",
		Columns:    LinkCategoriesColumns,
		PrimaryKey: []*schema.Column{LinkCategoriesColumns[0]},
	}
	// LinkTagsColumns holds the columns for the "link_tags" table.
	LinkTagsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeInt, Increment: true},
		{Name: "name", Type: field.TypeString, Unique: true},
		{Name: "color", Type: field.TypeString, Default: "#666666"},
	}
	// LinkTagsTable holds the schema information for the "link_tags" table.
	LinkTagsTable = &schema.Table{
		Name:       "link_tags",
		Columns:    LinkTagsColumns,
		PrimaryKey: []*schema.Column{LinkTagsColumns[0]},
	}
	// MetadataColumns holds the columns for the "metadata" table.
	MetadataColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint, Increment: true},
		{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "name", Type: field.TypeString, Size: 255},
		{Name: "value", Type: field.TypeString, Nullable: true, Size: 2147483647},
		{Name: "file_id", Type: field.TypeUint},
	}
	// MetadataTable holds the schema information for the "metadata" table.
	MetadataTable = &schema.Table{
		Name:       "metadata",
		Columns:    MetadataColumns,
		PrimaryKey: []*schema.Column{MetadataColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "metadata_files_metadata",
				Columns:    []*schema.Column{MetadataColumns[6]},
				RefColumns: []*schema.Column{FilesColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "metadata_file_id_name",
				Unique:  true,
				Columns: []*schema.Column{MetadataColumns[6], MetadataColumns[4]},
			},
		},
	}
	// PagesColumns holds the columns for the "pages" table.
	PagesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint, Increment: true},
		{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
		{Name: "title", Type: field.TypeString, Size: 255},
		{Name: "path", Type: field.TypeString, Unique: true, Size: 255},
		{Name: "content", Type: field.TypeString, Size: 2147483647},
		{Name: "markdown_content", Type: field.TypeString, Size: 2147483647, Default: ""},
		{Name: "description", Type: field.TypeString, Nullable: true, Size: 500},
		{Name: "is_published", Type: field.TypeBool, Default: true},
		{Name: "show_comment", Type: field.TypeBool, Default: false},
		{Name: "sort", Type: field.TypeInt, Default: 0},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
	}
	// PagesTable holds the schema information for the "pages" table.
	PagesTable = &schema.Table{
		Name:       "pages",
		Columns:    PagesColumns,
		PrimaryKey: []*schema.Column{PagesColumns[0]},
	}
	// PostCategoriesColumns holds the columns for the "post_categories" table.
	PostCategoriesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint, Increment: true},
		{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "name", Type: field.TypeString, Unique: true},
		{Name: "description", Type: field.TypeString, Nullable: true},
		{Name: "count", Type: field.TypeInt, Default: 0},
		{Name: "is_series", Type: field.TypeBool, Default: false},
	}
	// PostCategoriesTable holds the schema information for the "post_categories" table.
	PostCategoriesTable = &schema.Table{
		Name:       "post_categories",
		Columns:    PostCategoriesColumns,
		PrimaryKey: []*schema.Column{PostCategoriesColumns[0]},
	}
	// PostTagsColumns holds the columns for the "post_tags" table.
	PostTagsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint, Increment: true},
		{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "name", Type: field.TypeString, Unique: true},
		{Name: "count", Type: field.TypeInt, Default: 0},
	}
	// PostTagsTable holds the schema information for the "post_tags" table.
	PostTagsTable = &schema.Table{
		Name:       "post_tags",
		Columns:    PostTagsColumns,
		PrimaryKey: []*schema.Column{PostTagsColumns[0]},
	}
	// SettingsColumns holds the columns for the "settings" table.
	SettingsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeInt, Increment: true},
		{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
		{Name: "config_key", Type: field.TypeString, Unique: true, Size: 100},
		{Name: "value", Type: field.TypeString, Size: 2147483647},
		{Name: "comment", Type: field.TypeString, Nullable: true, Size: 255},
		{Name: "created_at", Type: field.TypeTime},
		{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]},
	}
	// StoragePoliciesColumns holds the columns for the "storage_policies" table.
	StoragePoliciesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint, Increment: true},
		{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "name", Type: field.TypeString, Unique: true, Size: 255},
		{Name: "type", Type: field.TypeString, Size: 255},
		{Name: "flag", Type: field.TypeString, Unique: true, Nullable: true, Size: 255},
		{Name: "server", Type: field.TypeString, Nullable: true, Size: 255},
		{Name: "bucket_name", Type: field.TypeString, Nullable: true, Size: 255},
		{Name: "is_private", Type: field.TypeBool, Nullable: true},
		{Name: "access_key", Type: field.TypeString, Nullable: true, Size: 2147483647},
		{Name: "secret_key", Type: field.TypeString, Nullable: true, Size: 2147483647},
		{Name: "max_size", Type: field.TypeInt64, Nullable: true},
		{Name: "base_path", Type: field.TypeString, Nullable: true, Size: 255},
		{Name: "virtual_path", Type: field.TypeString, Nullable: true, Size: 255},
		{Name: "settings", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"mysql": "json", "postgres": "jsonb", "sqlite3": "text"}},
		{Name: "node_id", Type: field.TypeUint, Nullable: true},
	}
	// StoragePoliciesTable holds the schema information for the "storage_policies" table.
	StoragePoliciesTable = &schema.Table{
		Name:       "storage_policies",
		Columns:    StoragePoliciesColumns,
		PrimaryKey: []*schema.Column{StoragePoliciesColumns[0]},
	}
	// TagsColumns holds the columns for the "tags" table.
	TagsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint, Increment: true},
		{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "name", Type: field.TypeString, Unique: true, Size: 100},
	}
	// TagsTable holds the schema information for the "tags" table.
	TagsTable = &schema.Table{
		Name:       "tags",
		Columns:    TagsColumns,
		PrimaryKey: []*schema.Column{TagsColumns[0]},
	}
	// URLStatsColumns holds the columns for the "url_stats" table.
	URLStatsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint, Increment: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "url_path", Type: field.TypeString, Size: 500},
		{Name: "page_title", Type: field.TypeString, Nullable: true, Size: 255},
		{Name: "total_views", Type: field.TypeInt64, Default: 0},
		{Name: "unique_views", Type: field.TypeInt64, Default: 0},
		{Name: "bounce_count", Type: field.TypeInt64, Default: 0},
		{Name: "avg_duration", Type: field.TypeFloat64, Default: 0},
		{Name: "last_visited_at", Type: field.TypeTime, Nullable: true},
	}
	// URLStatsTable holds the schema information for the "url_stats" table.
	URLStatsTable = &schema.Table{
		Name:       "url_stats",
		Columns:    URLStatsColumns,
		PrimaryKey: []*schema.Column{URLStatsColumns[0]},
		Indexes: []*schema.Index{
			{
				Name:    "urlstat_url_path",
				Unique:  true,
				Columns: []*schema.Column{URLStatsColumns[3]},
			},
			{
				Name:    "urlstat_total_views",
				Unique:  false,
				Columns: []*schema.Column{URLStatsColumns[5]},
			},
			{
				Name:    "urlstat_last_visited_at",
				Unique:  false,
				Columns: []*schema.Column{URLStatsColumns[9]},
			},
		},
	}
	// UsersColumns holds the columns for the "users" table.
	UsersColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint, Increment: true},
		{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "username", Type: field.TypeString, Unique: true, Size: 50},
		{Name: "password_hash", Type: field.TypeString, Size: 255},
		{Name: "nickname", Type: field.TypeString, Nullable: true, Size: 50},
		{Name: "avatar", Type: field.TypeString, Nullable: true, Size: 255},
		{Name: "email", Type: field.TypeString, Unique: true, Nullable: true, Size: 100},
		{Name: "website", Type: field.TypeString, Nullable: true, Size: 255},
		{Name: "last_login_at", Type: field.TypeTime, Nullable: true},
		{Name: "status", Type: field.TypeInt, Default: 2},
		{Name: "user_group_id", Type: field.TypeUint},
	}
	// UsersTable holds the schema information for the "users" table.
	UsersTable = &schema.Table{
		Name:       "users",
		Columns:    UsersColumns,
		PrimaryKey: []*schema.Column{UsersColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "users_user_groups_users",
				Columns:    []*schema.Column{UsersColumns[12]},
				RefColumns: []*schema.Column{UserGroupsColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
	}
	// UserGroupsColumns holds the columns for the "user_groups" table.
	UserGroupsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint, Increment: true},
		{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "name", Type: field.TypeString, Size: 50},
		{Name: "description", Type: field.TypeString, Nullable: true, Size: 255},
		{Name: "permissions", Type: field.TypeOther, SchemaType: map[string]string{"mysql": "text", "postgres": "text", "sqlite3": "text"}},
		{Name: "max_storage", Type: field.TypeInt64, Default: 0},
		{Name: "speed_limit", Type: field.TypeInt64, Default: 0},
		{Name: "settings", Type: field.TypeOther, SchemaType: map[string]string{"mysql": "json", "postgres": "jsonb", "sqlite3": "text"}},
	}
	// UserGroupsTable holds the schema information for the "user_groups" table.
	UserGroupsTable = &schema.Table{
		Name:       "user_groups",
		Columns:    UserGroupsColumns,
		PrimaryKey: []*schema.Column{UserGroupsColumns[0]},
	}
	// UserInstalledThemesColumns holds the columns for the "user_installed_themes" table.
	UserInstalledThemesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint, Increment: true},
		{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "theme_name", Type: field.TypeString, Size: 100},
		{Name: "theme_market_id", Type: field.TypeInt, Nullable: true},
		{Name: "is_current", Type: field.TypeBool, Default: false},
		{Name: "install_time", Type: field.TypeTime},
		{Name: "user_theme_config", Type: field.TypeJSON, Nullable: true},
		{Name: "installed_version", Type: field.TypeString, Nullable: true, Size: 50},
		{Name: "user_id", Type: field.TypeUint},
	}
	// UserInstalledThemesTable holds the schema information for the "user_installed_themes" table.
	UserInstalledThemesTable = &schema.Table{
		Name:       "user_installed_themes",
		Columns:    UserInstalledThemesColumns,
		PrimaryKey: []*schema.Column{UserInstalledThemesColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "user_installed_themes_users_installed_themes",
				Columns:    []*schema.Column{UserInstalledThemesColumns[10]},
				RefColumns: []*schema.Column{UsersColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "userinstalledtheme_user_id_is_current",
				Unique:  false,
				Columns: []*schema.Column{UserInstalledThemesColumns[10], UserInstalledThemesColumns[6]},
			},
			{
				Name:    "userinstalledtheme_theme_name",
				Unique:  false,
				Columns: []*schema.Column{UserInstalledThemesColumns[4]},
			},
			{
				Name:    "userinstalledtheme_user_id_theme_name",
				Unique:  true,
				Columns: []*schema.Column{UserInstalledThemesColumns[10], UserInstalledThemesColumns[4]},
			},
			{
				Name:    "userinstalledtheme_theme_market_id",
				Unique:  false,
				Columns: []*schema.Column{UserInstalledThemesColumns[5]},
			},
		},
	}
	// VisitorLogsColumns holds the columns for the "visitor_logs" table.
	VisitorLogsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint, Increment: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "visitor_id", Type: field.TypeString, Size: 255},
		{Name: "session_id", Type: field.TypeString, Nullable: true, Size: 255},
		{Name: "ip_address", Type: field.TypeString, Size: 45},
		{Name: "user_agent", Type: field.TypeString, Nullable: true, Size: 500},
		{Name: "referer", Type: field.TypeString, Nullable: true, Size: 500},
		{Name: "url_path", Type: field.TypeString, Size: 500},
		{Name: "country", Type: field.TypeString, Nullable: true, Size: 100},
		{Name: "region", Type: field.TypeString, Nullable: true, Size: 100},
		{Name: "city", Type: field.TypeString, Nullable: true, Size: 100},
		{Name: "browser", Type: field.TypeString, Nullable: true, Size: 100},
		{Name: "os", Type: field.TypeString, Nullable: true, Size: 100},
		{Name: "device", Type: field.TypeString, Nullable: true, Size: 100},
		{Name: "duration", Type: field.TypeInt, Default: 0},
		{Name: "is_bounce", Type: field.TypeBool, Default: false},
	}
	// VisitorLogsTable holds the schema information for the "visitor_logs" table.
	VisitorLogsTable = &schema.Table{
		Name:       "visitor_logs",
		Columns:    VisitorLogsColumns,
		PrimaryKey: []*schema.Column{VisitorLogsColumns[0]},
		Indexes: []*schema.Index{
			{
				Name:    "visitorlog_visitor_id",
				Unique:  false,
				Columns: []*schema.Column{VisitorLogsColumns[2]},
			},
			{
				Name:    "visitorlog_session_id",
				Unique:  false,
				Columns: []*schema.Column{VisitorLogsColumns[3]},
			},
			{
				Name:    "visitorlog_ip_address",
				Unique:  false,
				Columns: []*schema.Column{VisitorLogsColumns[4]},
			},
			{
				Name:    "visitorlog_url_path",
				Unique:  false,
				Columns: []*schema.Column{VisitorLogsColumns[7]},
			},
			{
				Name:    "visitorlog_created_at",
				Unique:  false,
				Columns: []*schema.Column{VisitorLogsColumns[1]},
			},
			{
				Name:    "visitorlog_created_at_visitor_id",
				Unique:  false,
				Columns: []*schema.Column{VisitorLogsColumns[1], VisitorLogsColumns[2]},
			},
		},
	}
	// VisitorStatsColumns holds the columns for the "visitor_stats" table.
	VisitorStatsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint, Increment: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
		{Name: "date", Type: field.TypeTime},
		{Name: "unique_visitors", Type: field.TypeInt64, Default: 0},
		{Name: "total_views", Type: field.TypeInt64, Default: 0},
		{Name: "page_views", Type: field.TypeInt64, Default: 0},
		{Name: "bounce_count", Type: field.TypeInt64, Default: 0},
	}
	// VisitorStatsTable holds the schema information for the "visitor_stats" table.
	VisitorStatsTable = &schema.Table{
		Name:       "visitor_stats",
		Columns:    VisitorStatsColumns,
		PrimaryKey: []*schema.Column{VisitorStatsColumns[0]},
		Indexes: []*schema.Index{
			{
				Name:    "visitorstat_date",
				Unique:  true,
				Columns: []*schema.Column{VisitorStatsColumns[3]},
			},
		},
	}
	// ArticlePostTagsColumns holds the columns for the "article_post_tags" table.
	ArticlePostTagsColumns = []*schema.Column{
		{Name: "article_id", Type: field.TypeUint},
		{Name: "post_tag_id", Type: field.TypeUint},
	}
	// ArticlePostTagsTable holds the schema information for the "article_post_tags" table.
	ArticlePostTagsTable = &schema.Table{
		Name:       "article_post_tags",
		Columns:    ArticlePostTagsColumns,
		PrimaryKey: []*schema.Column{ArticlePostTagsColumns[0], ArticlePostTagsColumns[1]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "article_post_tags_article_id",
				Columns:    []*schema.Column{ArticlePostTagsColumns[0]},
				RefColumns: []*schema.Column{ArticlesColumns[0]},
				OnDelete:   schema.Cascade,
			},
			{
				Symbol:     "article_post_tags_post_tag_id",
				Columns:    []*schema.Column{ArticlePostTagsColumns[1]},
				RefColumns: []*schema.Column{PostTagsColumns[0]},
				OnDelete:   schema.Cascade,
			},
		},
	}
	// ArticlePostCategoriesColumns holds the columns for the "article_post_categories" table.
	ArticlePostCategoriesColumns = []*schema.Column{
		{Name: "article_id", Type: field.TypeUint},
		{Name: "post_category_id", Type: field.TypeUint},
	}
	// ArticlePostCategoriesTable holds the schema information for the "article_post_categories" table.
	ArticlePostCategoriesTable = &schema.Table{
		Name:       "article_post_categories",
		Columns:    ArticlePostCategoriesColumns,
		PrimaryKey: []*schema.Column{ArticlePostCategoriesColumns[0], ArticlePostCategoriesColumns[1]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "article_post_categories_article_id",
				Columns:    []*schema.Column{ArticlePostCategoriesColumns[0]},
				RefColumns: []*schema.Column{ArticlesColumns[0]},
				OnDelete:   schema.Cascade,
			},
			{
				Symbol:     "article_post_categories_post_category_id",
				Columns:    []*schema.Column{ArticlePostCategoriesColumns[1]},
				RefColumns: []*schema.Column{PostCategoriesColumns[0]},
				OnDelete:   schema.Cascade,
			},
		},
	}
	// LinkTagPivotColumns holds the columns for the "link_tag_pivot" table.
	LinkTagPivotColumns = []*schema.Column{
		{Name: "link_id", Type: field.TypeInt},
		{Name: "link_tag_id", Type: field.TypeInt},
	}
	// LinkTagPivotTable holds the schema information for the "link_tag_pivot" table.
	LinkTagPivotTable = &schema.Table{
		Name:       "link_tag_pivot",
		Columns:    LinkTagPivotColumns,
		PrimaryKey: []*schema.Column{LinkTagPivotColumns[0], LinkTagPivotColumns[1]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "link_tag_pivot_link_id",
				Columns:    []*schema.Column{LinkTagPivotColumns[0]},
				RefColumns: []*schema.Column{LinksColumns[0]},
				OnDelete:   schema.Cascade,
			},
			{
				Symbol:     "link_tag_pivot_link_tag_id",
				Columns:    []*schema.Column{LinkTagPivotColumns[1]},
				RefColumns: []*schema.Column{LinkTagsColumns[0]},
				OnDelete:   schema.Cascade,
			},
		},
	}
	// Tables holds all the tables in the schema.
	Tables = []*schema.Table{
		AlbumsTable,
		ArticlesTable,
		CommentsTable,
		DirectLinksTable,
		EntitiesTable,
		FilesTable,
		FileEntitiesTable,
		LinksTable,
		LinkCategoriesTable,
		LinkTagsTable,
		MetadataTable,
		PagesTable,
		PostCategoriesTable,
		PostTagsTable,
		SettingsTable,
		StoragePoliciesTable,
		TagsTable,
		URLStatsTable,
		UsersTable,
		UserGroupsTable,
		UserInstalledThemesTable,
		VisitorLogsTable,
		VisitorStatsTable,
		ArticlePostTagsTable,
		ArticlePostCategoriesTable,
		LinkTagPivotTable,
	}
)

func init() {
	CommentsTable.ForeignKeys[0].RefTable = ArticlesTable
	CommentsTable.ForeignKeys[1].RefTable = CommentsTable
	CommentsTable.ForeignKeys[2].RefTable = UsersTable
	DirectLinksTable.ForeignKeys[0].RefTable = FilesTable
	FilesTable.ForeignKeys[0].RefTable = FilesTable
	FilesTable.ForeignKeys[1].RefTable = EntitiesTable
	FilesTable.ForeignKeys[2].RefTable = UsersTable
	FileEntitiesTable.ForeignKeys[0].RefTable = EntitiesTable
	FileEntitiesTable.ForeignKeys[1].RefTable = FilesTable
	LinksTable.ForeignKeys[0].RefTable = LinkCategoriesTable
	MetadataTable.ForeignKeys[0].RefTable = FilesTable
	UsersTable.ForeignKeys[0].RefTable = UserGroupsTable
	UserInstalledThemesTable.ForeignKeys[0].RefTable = UsersTable
	ArticlePostTagsTable.ForeignKeys[0].RefTable = ArticlesTable
	ArticlePostTagsTable.ForeignKeys[1].RefTable = PostTagsTable
	ArticlePostCategoriesTable.ForeignKeys[0].RefTable = ArticlesTable
	ArticlePostCategoriesTable.ForeignKeys[1].RefTable = PostCategoriesTable
	LinkTagPivotTable.ForeignKeys[0].RefTable = LinksTable
	LinkTagPivotTable.ForeignKeys[1].RefTable = LinkTagsTable
}
