Created
November 27, 2015 19:15
-
-
Save oscaroceguera/6598582cfd24099149eb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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