add database migration support
This commit is contained in:
parent
b72952b415
commit
74ab417191
|
@ -14,4 +14,4 @@ pom.xml.asc
|
||||||
/public/out
|
/public/out
|
||||||
/public/index.js
|
/public/index.js
|
||||||
/images
|
/images
|
||||||
|
/db
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"dev": {
|
||||||
|
"driver": "sqlite3",
|
||||||
|
"filename": "db/dev.db"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
var dbm = global.dbm || require('db-migrate');
|
||||||
|
var type = dbm.dataType;
|
||||||
|
|
||||||
|
exports.up = function(db, callback) {
|
||||||
|
db.createTable('images', {
|
||||||
|
id: {type: 'int', primaryKey: true},
|
||||||
|
path: 'string',
|
||||||
|
name: 'string',
|
||||||
|
width: 'int',
|
||||||
|
height: 'int',
|
||||||
|
type: 'string',
|
||||||
|
createdAt: 'int',
|
||||||
|
updatedAt: 'int'
|
||||||
|
}, callback);
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.down = function(db, callback) {
|
||||||
|
db.dropTable('images', callback);
|
||||||
|
};
|
|
@ -8,7 +8,9 @@
|
||||||
:source-paths ["src/server" "src/client"]
|
:source-paths ["src/server" "src/client"]
|
||||||
:npm { :dependencies [[ws "0.4.30"]
|
:npm { :dependencies [[ws "0.4.30"]
|
||||||
[imagemagick-native "https://github.com/elad/node-imagemagick-native.git"]
|
[imagemagick-native "https://github.com/elad/node-imagemagick-native.git"]
|
||||||
[express "4.13.3"]]}
|
[express "4.13.3"]
|
||||||
|
[sqlite3 "3.1.1"]
|
||||||
|
[db-migrate "0.9.23"]]}
|
||||||
:cljsbuild {
|
:cljsbuild {
|
||||||
:builds [{:source-paths ["src/server"]
|
:builds [{:source-paths ["src/server"]
|
||||||
:compiler {
|
:compiler {
|
||||||
|
|
Loading…
Reference in New Issue