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
1
vote
0 answers

ERROR Adaptive Server Requires encryption of the login password on the network - SQL Server Migration Assistant for Sybase

I'm trying to migrate Sybase Database to an SQL Server by assistant tool from Microsoft. When I try to connect to Sybase with ODBC Driver Provider in SQL Server Migration the error bellow appears. ERROR [ZZZZZ][SAP][ASE ODBC Driver][Adaptive Server…
1
vote
0 answers

db-migrate can't find heroku config vars at docker deploy

I'm trying to deploy a node Express app to Heroku using docker via a Gihub action ( uses: gonuit/heroku-docker-deploy@v1.3.3) and want to run db-migrate up in the Dockerfile. It looks like db-migrate can't take into account the config vars…
tminus109
  • 11
  • 1
1
vote
1 answer

ScyllaDB - DynamoDB Migration

Agenda- Migrate DynamoDB tables to ScyllaDB (Schema as well as data) Does the Scylla-Migrator - https://github.com/scylladb/scylla-migrator can migrate the table schema as well, or I have to create the exact schema in my ScyllaDB and then it can…
1
vote
3 answers

Web service for custom queries in C#

We are migrating from an ASP.NET/SQL server setup to a rails/mysql setup. Because of this, I need to transfer the data out of my SQL Server database, but I can't directly move it from SQL Server to mysql because there are some things which need to…
dingalingchickenwiing
  • 1,937
  • 3
  • 20
  • 30
1
vote
0 answers

db-migrate for node-postgres in next.js app not finding env variables on heroku

I'm trying to run db-migrate for postgres on heroku but cannot seem to figure out why it doesn't have the right env variables. Hoping for some guidance if someone else has encountered a similar problem. I created a next.js app. Locally, I have a…
davidatthepark
  • 1,235
  • 1
  • 13
  • 25
1
vote
0 answers

Altering db migration script with Flyway

I'm not really sure what I've done wrong. But this caused the other services to mess up the other db migration stuff. Hoping someone will help me with the cause. Thank you! We have a db migration script that creates a…
mengmeng
  • 1,266
  • 2
  • 22
  • 46
1
vote
3 answers

Rail6 db:migrate fails - wrong number of arguments (given 1, expected 0)

I am unable to create tables (i.e. run db:migrate successfully) in Rail 6 on Windows 7. Just in case I completely reinstalled rails by Installing Ruby 2.6 development pack and doing a 'gem install rails' which for me installed Rails 6.0.3.1 I…
1
vote
1 answer

How to upgrade mariadb from a sql dump file?

I have a sql dump file generated by mysqldump of mariadb 10.2. I want to set up a new db server using mariadb 10.4 with data coming from the sql dump file. Is the upgrade process necessary in this case? If so, should I first restore the sql file…
hgl
  • 2,034
  • 4
  • 21
  • 30
1
vote
0 answers

How can i auto restart pm2 server when db-migrate command run?

I am using the pm2 npm package and DB-migrate npm package. What I want - Either when I migrate my DB so - db-migrate up , so pm2 restart 0 command also execute. command auto execute to restart my server. Or I just run the pm2 start command.…
Shivam Gupta
  • 533
  • 4
  • 9
1
vote
1 answer

Rails Git Migration Issue With Branches

Still a newbie. I'm working on a new feature for a RoR app. I created a local branch and generated a migration. Unfortunately I didn't save my changes to the migration file and then ran db:migrate. Wanting to start over, I switched back to master…
Mike N.
  • 89
  • 8
1
vote
2 answers

What role permission needed for the user to get the server_version in Amazon redshift DB?

Currently i have a user called master in redshift which has SuperUser permission. analytics=# \du List of roles Role name | Attributes | Member of…
Sangeeth
  • 335
  • 3
  • 13
1
vote
1 answer

rake db:migrate returns "rake: Is a directory"?

I've been searching for the answer to this question for a week, but haven't found one. I'm running Mac OS 10.5.8 if that's relevant. I'm trying to do the Peepcode tutorial "Meet Rails 3" but when I run the command line user$ rake db:migrate I get…
Josh
  • 13
  • 3
1
vote
1 answer

Creating Dynamic user inside the Dockerfile - MySQL

I am trying to solve a problem with Docker and MySQL. I have Docker file: FROM mysql:5.6 ADD setup.sql /docker-entrypoint-initdb.d RUN apt-get -qq update && apt-get install -y expect RUN echo "test" | unbuffer -p mysql_config_editor set…
Amiga500
  • 5,874
  • 10
  • 64
  • 117
1
vote
1 answer

Why am I getting duplicate version error using db:migrate VERSION=XXX?

I'm working with an application that was upgraded from Ruby 1.8.6 to Ruby 1.8.7. I created a number of migration scripts named as 999_whatever_function.rb, ordered sequentially. The whole set from previous runs have items from 001 until 430, and I…
Ivana
  • 11
  • 2
1
vote
3 answers

rake db:migrate is creating tables from other rails projects

I have created a new rails project and I have added a migration to create a table called blogs. When I ran rake db:migrate it created this table along with other tables I have set in different projects. Under db/migrate I have only 1 file with the…