Sha256: a87df996df6d84b6c6d525903f6f17f97003abfb8745bfe8c0f4d2ab7702c7ed
Contents?: true
Size: 924 Bytes
Versions: 25
Compression:
Stored size: 924 Bytes
Contents
class CreatePandaCmsPosts < ActiveRecord::Migration[7.1] def change create_table :panda_cms_post_tags, id: :uuid do |t| t.string :tag t.string :description t.string :slug t.timestamps t.index :tag, unique: true t.index :slug, unique: true end create_table :panda_cms_posts, id: :uuid do |t| t.string :title t.string :slug t.text :content t.datetime :published_at t.references :post_tag, type: :uuid, null: false, foreign_key: {to_table: :panda_cms_post_tags} t.references :user, type: :uuid, null: false, foreign_key: {to_table: :panda_cms_users} t.timestamps t.index :slug, unique: true end create_enum :panda_cms_post_status, ["active", "draft", "hidden", "archived"] add_column :panda_cms_posts, :status, :panda_cms_post_status, default: "draft", null: false add_index :panda_cms_posts, :status end end
Version data entries
25 entries across 25 versions & 1 rubygems