src/migration.js
function() {
	var me = {};
	var db = common.config.database;

	me.act = new NobleMachine();

	return _.extend(me, {
		create_table: function(name, definer) {
			var t = new TableDefinition(name, 'create', definer);
			me.act.next(t.act);
		},

		change_table: function(name, definer) {
			var t = new TableDefinition(name, 'alter', definer);
			me.act.next(t.act);
		},

		drop_table: function(name) {
			me.act.next(db.query(" DROP TABLE `" + name + "`;"));
		},

		rename_table: function(name, newname) {
			me.act.next(db.query(" ALTER TABLE `" + name + "` RENAME `" + newname + "`"));
		},
	});
}
function() {
	var me = {};
	var db = common.config.database;

	me.act = new NobleMachine();

	return _.extend(me, {
		create_table: function(name, definer) {
			var t = new TableDefinition(name, 'create', definer);
			me.act.next(t.act);
		},

		change_table: function(name, definer) {
			var t = new TableDefinition(name, 'alter', definer);
			me.act.next(t.act);
		},

		drop_table: function(name) {
			me.act.next(db.query(" DROP TABLE `" + name + "`;"));
		},

		rename_table: function(name, newname) {
			me.act.next(db.query(" ALTER TABLE `" + name + "` RENAME `" + newname + "`"));
		},
	});
}
function ( ) { var me = { } ; var db = common . config . database ; me . act = new NobleMachine ( ) ; return _ . extend ( me , { create_table : function ( name , definer ) { var t = new TableDefinition ( name , 'create' , definer ) ; me . act . next ( t . act ) ; } , change_table : function ( name , definer ) { var t = new TableDefinition ( name , 'alter' , definer ) ; me . act . next ( t . act ) ; } , drop_table : function ( name ) { me . act . next ( db . query ( " DROP TABLE `" + name + "`;" ) ) ; } , rename_table : function ( name , newname ) { me . act . next ( db . query ( " ALTER TABLE `" + name + "` RENAME `" + newname + "`" ) ) ; } , } ) ; }
Database definition class. Conglomerates TableDefinitions and SQL actions corresponding to friendly definition calls.
Database definition class . Conglomerates TableDefinitions and SQL actions corresponding to friendly definition calls .