How to use the migrations plugin correctly?

53 views
Skip to first unread message

Michael Weimann

unread,
Nov 16, 2013, 6:49:12 AM11/16/13
to persis...@googlegroups.com
Hello,

I have some trouble to get the migrations plugin working.

Currently I run this first:

persistence.store.websql.config(persistence, 'somedb', 'somedb', 10 * 1024 * 1024);
persistence.migrations.init();



Then I define the migration like this:

persistence.defineMigration(1, {
    up: function() {
        this.createTable('ATable', function(table) {
...


In addition to that, I define the current model:

var ATable = persistence.define('ATable')...

After that I call

persistence.migrate(1);

The console log output shows, that some table create statements are executed, but when I look into the database file, there are no tables.

What's the correct way to initialize persistence js and use the migrations? Is there any example available?

Tanks

Michael

Reply all
Reply to author
Forward
0 new messages