Permalink
Browse files

Update migrations to new format.

  • Loading branch information...
1 parent 4108180 commit 5ae9c6b6d95d2538d751701edc455296aa5fd443 @patcon patcon committed May 9, 2015
@@ -1,14 +1,14 @@
module.exports = {
up: function(migration, DataTypes, done) {
- migration.migrator.sequelize.query(
+ migration.sequelize.query(
'INSERT INTO RomVariants (DeviceId, subdirectory) SELECT DISTINCT DeviceId, subdirectory FROM Roms'
);
done();
},
down: function(migration, DataTypes, done) {
- migration.migrator.sequelize.query(
+ migration.sequelize.query(
'DELETE FROM RomVariants'
);
@@ -1,14 +1,14 @@
module.exports = {
up: function(migration, DataTypes, done) {
- migration.migrator.sequelize.query(
+ migration.sequelize.query(
'UPDATE Roms SET RomVariantId = (SELECT rv.id FROM RomVariants rv WHERE rv.DeviceId = Roms.DeviceId AND (rv.subdirectory = Roms.subdirectory OR (Roms.subdirectory IS NULL AND rv.subdirectory IS NULL)))'
);
done();
},
down: function(migration, DataTypes, done) {
- migration.migrator.sequelize.query(
+ migration.sequelize.query(
'UPDATE Roms SET subdirectory = (SELECT rv.subdirectory FROM RomVariants rv WHERE rv.id = Roms.RomVariantId), DeviceId = (SELECT rv.DeviceId FROM RomVariants rv WHERE rv.id = Roms.RomVariantId)'
);
@@ -1,14 +1,14 @@
module.exports = {
up: function(migration, DataTypes, done) {
- migration.migrator.sequelize.query(
+ migration.sequelize.query(
'UPDATE Incrementals SET RomVariantId = (SELECT rv.id FROM RomVariants rv WHERE rv.DeviceId = (SELECT r.DeviceId FROM Roms r WHERE r.id = Incrementals.sourceRomId) AND (rv.subdirectory = Incrementals.subdirectory OR (Incrementals.subdirectory IS NULL AND rv.subdirectory IS NULL)))'
);
done();
},
down: function(migration, DataTypes, done) {
- migration.migrator.sequelize.query(
+ migration.sequelize.query(
'UPDATE Incrementals SET subdirectory = (SELECT rv.subdirectory FROM RomVariants rv WHERE rv.id = Incrementals.RomVariantId)'
);
@@ -1,10 +1,10 @@
module.exports = {
up: function(migration, DataTypes, done) {
- migration.migrator.sequelize.query('UPDATE RomVariants SET name = id');
+ migration.sequelize.query('UPDATE RomVariants SET name = id');
done()
},
down: function(migration, DataTypes, done) {
- migration.migrator.sequelize.query('UPDATE RomVariants SET name = NULL');
+ migration.sequelize.query('UPDATE RomVariants SET name = NULL');
done()
}
}

0 comments on commit 5ae9c6b

Please sign in to comment.