Skip to content

Instantly share code, notes, and snippets.

@oscaroceguera
Created November 27, 2015 19:15
Show Gist options
  • Save oscaroceguera/6598582cfd24099149eb to your computer and use it in GitHub Desktop.
Save oscaroceguera/6598582cfd24099149eb to your computer and use it in GitHub Desktop.
var Schema = {
users : {
id : {type : 'increments', nullable: false, primary: true},
email : {type : 'string', maxlength: 254, nullable: false, unique: true},
name : {type : 'string', maxlength: 150, nullable: false},
created_at: {type: 'dateTime', nullable: false},
updated_at: {type: 'dateTime', nullable: true}
},
categories: {
id: {type: 'increments', nullable: false, primary: true},
name: {type: 'string', maxlength: 150, nullable: false},
created_at: {type: 'dateTime', nullable: false},
updated_at: {type: 'dateTime', nullable: true}
},
posts: {
id: {type: 'increments', nullable: false, primary: true},
user_id: {type: 'integer', nullable: false, unsigned: true},
category_id: {type: 'integer', nullable: false, unsigned: true},
title: {type: 'string', maxlength: 150, nullable: false},
slug: {type: 'string', maxlength: 150, nullable: false, unique: true},
html: {type: 'text', maxlength: 16777215, fieldtype: 'medium', nullable: false},
created_at: {type: 'dateTime', nullable: false},
updated_at: {type: 'dateTime', nullable: true}
},
tags: {
id: {type: 'increments', nullable: false, primary: true},
slug: {type: 'string', maxlength: 150, nullable: false, unique: true},
name: {type: 'string', maxlength: 150, nullable: false}
},
posts_tags: {
id: {type: 'increments', nullable: false, primary: true},
post_id: {type: 'integer', nullable: false, unsigned: true},
tag_id: {type: 'integer', nullable: false, unsigned: true}
}
};
module.exports = Schema;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment