This repository has been archived by the owner on Aug 5, 2021. It is now read-only.
Releases: PhilWaldmann/openrecord
Releases · PhilWaldmann/openrecord
destroy() scope bugfix
v0.5.2 destroy() scope bugfix
add hasOne relations
It's now possible to add has one
relations via this.hasOne('relation_name');
Migration support added
It's not possible to add migrations!
Define a migration similar to a model:
/migrations/20140225152117_create_users.js
module.exports = function(){
this.createTable('users', function(){
this.string('login', {not_null: true});
this.string('first_name');
});
};
The id
column will be added automatically
Define your store with a migrations
option
var store = new Store({
type: 'postgres',
models: __dirname + '/models/*',
migrations: __dirname + '/migrations/*',
// + connection options
});
and it will automatically run all missing migrations for you.
Select bugfixes
v0.3.6 select bugfix
Postgres automatic validation bugfix
v0.3.5 postgres length bugfix
Missing Attributes and validatesUniquenessOf() bugfixes
null
or false
values will be loaded now.
Relation enhancements
It's now possible to create a new record via a relation.
e.g.
//Definition
Model('User', function(){
this.hasMany('posts');
});
//Usage
User.find(1, function(user){
user.posts.create({message:'foo'}, function(){
//the new post automatically get's a the user_id set
});
});
or via user.posts.new()
or user.posts.add(new_record)
or user.posts = [new_record1, new_record2]
or user.posts = new_record
Postgres Date, Datetime und Time bugfixes
v0.3.2 postgres date, datetime und time bugfix
Bugfix on record updates
v0.3.1 update bugfix
Add full Postgres support
- All tests run on SQLite3 and Postgres now
- new Validator methods:
validatesLengthOf()
andvalidatesNumericalityOf
validatesUniquenessOf()
now accepts options. It's now possible to define ascope