Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit af9a5a72
authored
Apr 26, 2011
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
documentation about basic mappings and model definitions
1 parent
2dbc0075
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
doc/views/index/code/usage/basic-mapping.ejs
doc/views/index/code/usage/basic-mapping.ejs
View file @
af9a5a7
...
...
@@ -14,5 +14,11 @@ var Foo = sequelize.define('Foo', {
// instantiating will automatically set the flag to true if not set
flag: { dataType: Sequelize.BOOLEAN, allowNull: false, defaultValue: true},
// setting no title will throw an error when trying to save
title: { dataType: Sequelize.STRING, allowNull: false}
title: { dataType: Sequelize.STRING, allowNull: false},
// creating 2 objects with the same value will throw an error
someUnique: {dataType: Sequelize.STRING, unique: false},
// go on reading for further information about primary keys
identifier: { dataType: Sequelize.String, primaryKey: true},
// autoIncrement can be used to create auto_incrementing integer columns
incrementMe: { dataType: Sequelize.INTEGER, autoIncrement: true }
})
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment