appwrite-utils-cli
Version:
Appwrite Utility Functions to help with database management, data conversion, data import, migrations, and much more. Meant to be used as a CLI tool, I do not recommend installing this in frontend environments.
227 lines (194 loc) • 4.67 kB
YAML
# yaml-language-server: $schema=../.yaml_schemas/collection.schema.json
# Collection Definition: Posts
name: Posts
id: 01JYDBQTB5W8SCBAYB654POSTS
documentSecurity: false
enabled: true
permissions:
- permission: read
target: any
- permission: create
target: users
- permission: update
target: users
- permission: delete
target: users
attributes:
# Core Content
- key: title
type: string
size: 200
required: true
description: "Post title or headline"
- key: slug
type: string
size: 250
required: false
description: "URL-friendly version of the title"
- key: content
type: string
size: 10000
required: true
description: "Main post content (supports HTML/Markdown)"
- key: excerpt
type: string
size: 500
required: false
description: "Brief summary or excerpt of the post"
# Relationships (manual references)
- key: authorId
type: string
size: 50
required: true
description: "User ID of the post author (manual reference)"
- key: categoryId
type: string
size: 50
required: false
description: "Category ID for the post (manual reference)"
# Media
- key: featuredImage
type: string
size: 255
required: false
description: "Featured image file ID stored in Appwrite storage"
- key: gallery
type: string
size: 2000
required: false
array: true
description: "Array of image file IDs for post gallery"
# Metadata
- key: tags
type: string
size: 50
required: false
array: true
description: "Array of tags associated with the post"
- key: status
type: enum
elements: ["draft", "published", "archived", "scheduled"]
required: true
default: "draft"
description: "Publication status of the post"
- key: publishedAt
type: datetime
required: false
description: "Date and time when the post was published"
- key: scheduledAt
type: datetime
required: false
description: "Date and time when the post is scheduled to be published"
# Engagement Metrics
- key: viewCount
type: integer
required: true
default: 0
min: 0
description: "Number of times the post has been viewed"
- key: likeCount
type: integer
required: true
default: 0
min: 0
description: "Number of likes the post has received"
- key: commentCount
type: integer
required: true
default: 0
min: 0
description: "Number of comments on the post"
- key: shareCount
type: integer
required: true
default: 0
min: 0
description: "Number of times the post has been shared"
# SEO & Social
- key: metaTitle
type: string
size: 60
required: false
description: "SEO meta title (max 60 chars)"
- key: metaDescription
type: string
size: 160
required: false
description: "SEO meta description (max 160 chars)"
- key: socialImage
type: string
size: 255
required: false
description: "Social media sharing image file ID"
# Reading Time
- key: readingTime
type: integer
required: false
min: 1
description: "Estimated reading time in minutes"
# Featured Status
- key: isFeatured
type: boolean
required: true
default: false
description: "Whether this post is featured on the homepage"
- key: isPinned
type: boolean
required: true
default: false
description: "Whether this post is pinned to the top"
indexes:
# Search indexes
- key: title_search
type: fulltext
attributes:
- title
- key: content_search
type: fulltext
attributes:
- content
- key: combined_search
type: fulltext
attributes:
- title
- content
- excerpt
# Query optimization
- key: status_published
type: key
attributes:
- status
- publishedAt
- key: author_status
type: key
attributes:
- authorId
- status
- key: category_status
type: key
attributes:
- categoryId
- status
- key: featured_status
type: key
attributes:
- isFeatured
- status
- key: views_desc
type: key
attributes:
- viewCount
orders:
- desc
- key: likes_desc
type: key
attributes:
- likeCount
orders:
- desc
# Unique constraints
- key: slug_unique
type: unique
attributes:
- slug
importDefs: []