Sha256: c89a86d8344b9474a982b914bbd34355c5f1212c80de7e9474402e29228909b2

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 KB

Contents

BLOG_SCHEMA = {
  tables: {
    users: [
      { name: :id, type: String, options: { primary_key: true } },
      { name: :first_name, type: String },
      { name: :last_name, type: String },
      { name: :email, type: String },
    ],
    posts: [
      { name: :id, type: String, options: { primary_key: true } },
      { name: :subject, type: String },
      { name: :body, type: String },
      { name: :author_id, type: String},
      { name: :created_at, type: DateTime },
    ],
    comments: [
      { name: :id, type: String, options: { primary_key: true } },
      { name: :body, type: String },
      { name: :post_id, type: String },
      { name: :commenter_id, type: String },
    ],
    categories: [
      { name: :id, type: String, options: { primary_key: true } },
      { name: :name, type: String },
    ],
    categories_to_posts: [
      { name: :post_id, type: String },
      { name: :category_id, type: String },
    ],
  },
  foreign_keys: [
    [:posts, :author_id, :users, :id],
    [:comments, :post_id, :posts, :id],
    [:comments, :commenter_id, :users, :id],
    [:categories_to_posts, :post_id, :posts, :id],
    [:categories_to_posts, :category_id, :categories, :id],
  ]
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
terrestrial-0.3.0 spec/support/blog_schema.rb
terrestrial-0.1.1 spec/support/blog_schema.rb