Questions tagged [dbmigrate]

Database migration framework.

What question should have this tag?

Database migration related question using a framework.

Basic Definitions

Database migration refers to the change of schema over time. It is common for a project's schemas to evolve depends on the need. Similarly, migration can help to add or remove columns from the schema/table.

Introduction

Typically a migration has an up and down method, so you can roll back any migrations. For example in nodejs, a migration might look like this:

//20180722013000-location.ts

exports.up = (db: any) => {
    return db.createTable("Location", {
        description: "text",
        geoCode: "jsonb",
        id: {
            allowNull: false,
            autoIncrement: true,
            primaryKey: true,
            type: "int",
        },
        locationId: "int",
        name: "string",
        open: "boolean",
    });
};

exports.down = (db: any) => {
    return db.dropTable("Location");
};

This migration will handle creating a table with that scheme on up and dropTable on down.

Learn more

Rails Active Record migration

Node Migration

Sequelize cli // A simple solution for migration and even support seeding

290 questions
0
votes
1 answer

node.js db-migrate create extension issue

I use the db-migrate to create the table. I have a sql statement. CREATE EXTENSION IF NOT EXISTS pgcrypto; But I got a error. [ERROR] AssertionError [ERR_ASSERTION]: ifError got unwanted exception: could not load library…
0
votes
1 answer

Appending JSON like string in MySQL

I have a JSON structured string stored in table "table", field "field", and need to modify this string directly for a database migration. Let's say the string looks like {"foo": false," bar": true}, but can have an arbitrary length based off the…
0
votes
0 answers

ERROR: function csvread(unknown) does not exist flyway migrate

I try to use flywayDB opensource - migrate function and try to create table from CSV file but I get ERROR : Migration V1__Add_new_tables.sql failed --------------------------------------- SQL State : 42883 Error Code : 0 Message : ERROR:…
0
votes
0 answers

Oracle DB to Big-query using Apache NiFi. Error while querying the same tables

We are migrating all the tables from Oracle to Bigquery through Apache NiFi. After successfully dumping the tables into Bigquery we are getting following Error while trying to query them in BQ CLI or GUI. Query Failed Error: Not found: Dataset…
0
votes
2 answers

Grails LIQUIBASE DB-DIFF Generating ERRORS

Welcome to Grails 1.3.5 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: C:\Users\ferron\Desktop\New folder\springsource-tool-suite-2.5.0.M3-e3.6-win32\springsource_3\grails-1.3.5\ Base Directory:…
ferronrsmith
  • 1,110
  • 5
  • 28
  • 47
0
votes
3 answers

laravel db migrate getting error

When I run php artisan migrate, I am getting an error like this: In 2017_12_26_045926_create_table_articles.php line 41: Parse error: syntax error, unexpected 'public' (T_PUBLIC), expecting ',' or ')' This is my articles…
bimoan
  • 189
  • 5
  • 17
0
votes
0 answers

rake db:migration not working

I'm still in student mode. Trying to expand my knowledge about deployment. I run into a rake db:migrate issue and get the following error message on Windows 10. I added passwords etc but my issue didn't resolve. rake aborted! PG::ConnectionBad:…
0
votes
1 answer

Migrating and Ingres Data Base to SQL Server 2008

I have a cline that is looking to convert an Ingres Database into SQL Server 2008. WE can easily convert the tables but there are a large number of views and procedures that are complex. Does anyone know of a method or tool that can convert these…
0
votes
1 answer

Editing Database field type using db:migrate

I am working on a Ruby on Rails web application and I am interested in changing the type of two of the fields in my Project model. When I created the Model I gave two of my fields (start_time and end_time) the type int and I would like to change it…
Nachshon Schwartz
  • 15,289
  • 20
  • 59
  • 98
0
votes
1 answer

Mocha with db-migrate fails to complete tests

I'm having some difficulty figuring out how to properly test this bit of code: const chai = require('chai') const chaiHttp = require('chai-http') const restify = require('restify') const errs = require('restify-errors') const expect =…
Allen Luce
  • 7,859
  • 3
  • 40
  • 53
0
votes
1 answer

keystonejs migrate users with password from another system

I have existing system and want to migrate all data to keystonejs. Problem is - my system use phone as identity vs keystonejs using email - in old database, I have password and salt fields. The encryption algorithm is SHA512. How do I convert it…
Phong Nguyen
  • 41
  • 1
  • 5
0
votes
1 answer

DB Migration in iOS?

I have an app in which I haven't set the SQLite version in and now I want to upgrade the app but I have some column changes in the new iPA. How can I implement the DB Migration in iOS? I am using FMDB for the database.
Nik
  • 1,679
  • 1
  • 20
  • 36
0
votes
1 answer

Failure upon migrate init (mybatis-migrate) caused by not finding template_README in the mybatis-migrations.jar

Just installed mybatis-migrate on my macbook and I haven't been able to run migrate init without getting this error: ERROR: Error copying org/apache/ibatis/migration/template_README to {projectDirectory}/./README. Cause:…
Lucas Earl
  • 395
  • 1
  • 3
  • 13
0
votes
1 answer

How to migrate parse exported database?

I have couple of parse database files in JSON format. I have installed parse open server on aws using elastic beanstalk successfully. I have gone through lots of tutorials which explains how db migration is done for parse on mongodb from parse…
Pratap Vhatkar
  • 691
  • 10
  • 21
0
votes
1 answer

Migrating data from 2 different SQL Server databases using console app

I have 2 web applications which are let's say Legacy1 and New1. I have separate DbContext for both applications and separate databases. Now I want to migrate data from the Legacy1 database to the New1 database. I cannot simply use copy database or…
Venkata Dorisala
  • 4,783
  • 7
  • 49
  • 90