Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var dbm = require('db-migrate');
var type = dbm.dataType;
exports.up = function(db, callback) {
db.createTable('outgoing_transactions', {
/* Auto-generated */
created_at: {type: 'timestamp'},
updated_at: {type: 'timestamp'},
/* Added initially */
initial_hash: {type: 'text', primaryKey: true},
submitted_at_ledger: {type: 'int'},
src_address: {type: 'text'},
tx_type: {type: 'text'},
tx_state: {type: 'text'}, // Updated after submission
/* Added after submission */
var dbm = require('db-migrate');
var type = dbm.dataType;
exports.up = function(db, callback) {
db.createTable('notifications', {
/* Auto-generated */
createdAt: {type: 'timestamp'},
updatedAt: {type: 'timestamp'},
/* rippled fields */
'"txHash"': {type: 'text', primaryKey: true},
txResult: {type: 'text'},
inLedger: {type: 'int'},
/* ripple-simple fields */
'"notificationAddress"': {type: 'text', primaryKey: true},
txType: {type: 'text'},
txDirection: {type: 'text'},
var dbm = require('db-migrate');
var type = dbm.dataType;
exports.up = function(db, callback) {
db.createTable('client_resource_id_records', {
/* Auto-generated */
id: {type: 'int'},
created_at: {type: 'timestamp'},
updated_at: {type: 'timestamp'},
source_account: {type: 'text', primaryKey: true},
type: {type: 'text', primaryKey: true},
client_resource_id: {type: 'text', primaryKey: true},
hash: {type: 'text'},
ledger: {type: 'text'},
state: {type: 'text'},
result: {type: 'text'}
var dbm = require('db-migrate');
var type = dbm.dataType;
var async = require('async');
exports.up = function(db, callback) {
async.series([
db.runSql.bind(db, "CREATE TABLE IF NOT EXISTS `badgeCategory` ("
+ " id BIGINT AUTO_INCREMENT PRIMARY KEY,"
+ " label VARCHAR(128) NOT NULL,"
+ " description VARCHAR(255)"
+ ") ENGINE=InnoDB;"),
db.runSql.bind(db, "CREATE TABLE IF NOT EXISTS `_badgeCategory` ("
+ " id BIGINT AUTO_INCREMENT PRIMARY KEY,"
+ " badgeId BIGINT NOT NULL,"
+ " categoryId BIGINT NOT NULL,"
+ " UNIQUE KEY `badge_and_category` (`badgeId`, `categoryId`),"
+ " UNIQUE KEY `category_and_badge` (`categoryId`, `badgeId`),"
+ " FOREIGN KEY (badgeId) REFERENCES `badge`(`id`) ON DELETE CASCADE,"
var dbm = require('db-migrate');
var async = require('async');
var type = dbm.dataType;
exports.up = function(db, callback) {
async.series([
db.runSql.bind(db,
"ALTER TABLE `badge` "
+ "ADD `created` TIMESTAMP DEFAULT '2000-01-01 00:00:00',"
+ "ADD `lastUpdated` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
),
db.runSql.bind(db,
"ALTER TABLE `image` "
+ "ADD `lastUpdated` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,"
+ "ADD `url` VARCHAR(255),"
+ "MODIFY `mimetype` VARCHAR(255) NULL,"
+ "MODIFY `data` LONGBLOB NULL"
),
db.runSql.bind(db,
var dbm = require('db-migrate');
var type = dbm.dataType;
exports.up = function(db, callback) {
db.runSql("CREATE TABLE IF NOT EXISTS `badge` ("
+ "id BIGINT AUTO_INCREMENT PRIMARY KEY,"
+ "name VARCHAR(128) NOT NULL,"
+ "status ENUM('draft', 'template', 'published', 'archived') NOT NULL"
+ ") ENGINE=InnoDB;", callback);
};
exports.down = function(db, callback) {
db.runSql("DROP TABLE IF EXISTS `badge`;", callback);
};
var dbm = require('db-migrate');
var type = dbm.dataType;
var async = require('async');
exports.up = function(db, callback) {
async.series([
db.runSql.bind(db,
"CREATE TABLE IF NOT EXISTS `image` ("
+ "id BIGINT AUTO_INCREMENT PRIMARY KEY,"
+ "mimetype VARCHAR(255) NOT NULL,"
+ "data LONGBLOB NOT NULL"
+ ") ENGINE=InnoDB"
),
db.runSql.bind(db,
"ALTER TABLE `badge` "
+ "ADD `imageId` BIGINT,"
+ "ADD `studioShape` VARCHAR(255),"
+ "ADD `studioBackground` VARCHAR(255),"
var dbm = require('db-migrate');
var type = dbm.dataType;
var async = require('async');
exports.up = function(db, callback) {
async.series([
db.runSql.bind(db,
"ALTER TABLE `badge` "
+ "ADD `system` VARCHAR(255) NOT NULL DEFAULT 'badgekit',"
+ "ADD `issuer` VARCHAR(255) NULL,"
+ "ADD `program` VARCHAR(255) NULL"
),
db.runSql.bind(db,
"CREATE TABLE IF NOT EXISTS `account` ("
+ "`id` BIGINT AUTO_INCREMENT PRIMARY KEY,"
+ "`email` VARCHAR(255) NOT NULL UNIQUE,"
+ "INDEX `email_idx`(`email`)"
+ ") ENGINE=InnoDB;"
var async = require('async'),
dbm = require('db-migrate'),
type = dbm.dataType;
exports.up = function (db, callback) {
async.series([
db.createTable.bind(db, 'guests', {
columns: {
id: {
autoIncrement: true,
primaryKey : true,
type : 'int'
},
invitation_id: 'int',
title: {type: 'string', length: 8},
name : {type: 'string', length: 64},
email: {type: 'string', length: 128},
var dbm = require('db-migrate');
var type = dbm.dataType;
var async = require('async');
exports.up = function(db, callback) {
async.series([
db.runSql.bind(db,
"ALTER TABLE `badge` "
+ "ADD `issuerUrl` TEXT,"
+ "ADD `earnerDescription` TEXT,"
+ "ADD `consumerDescription` TEXT,"
+ "ADD `tags` TEXT,"
+ "ADD `rubricUrl` TEXT,"
+ "ADD `timeValue` INT,"
+ "ADD `timeUnits` ENUM('minutes', 'hours', 'days', 'weeks'),"
+ "ADD `limit` INT,"
+ "ADD `multiClaimCode` TEXT,"
+ "ADD `unique` BOOL NOT NULL DEFAULT FALSE,"