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

How to program with Liquibase XML files

I am used to DB programming with pure SQL files, but even if using an IDE, I am comfortable in seeing SQL commands like so as I can sit down with my developers and troubleshoot problems we encounter create or replace function register_user ( …
puk
  • 16,318
  • 29
  • 119
  • 199
0
votes
1 answer

Heroku rake db:migrate fails, undefined method in uninstalled gem

I am trying to get my application on Heroku, but when I run heroku rake db:migrate I get the following errors. It seems like the event_calendar gem is causing the problem, but the thing is, I've uninstalled it. There is no reference to it in the…
Alexei
  • 127
  • 13
0
votes
1 answer

migration from mysql to oracle hits ora-01400

I followed instruction for migrating MySQL to oracle, at the last step(press finish), we hit the following error: Migration actions have failed, check the migration reports for details: capture Classic capture ora-01400: cannot insert null into…
0
votes
0 answers

Discrepancy with structure.sql in Rails 4 app?

We have a Rails 4 app right now that is using Postgresql. All the devs today got upgraded/downgraded to the same version: PostgreSQL 12.6. However, for a couple of us, when we run rake db:migrate the alterations to structure.sql seem to be slightly…
0
votes
1 answer

Django: models setup for using one database to populate another

I'm rebuilding a personal project in Django, (a family tree), and I'm working on migrating the actual data from the old awkward database to my new model/schema, both Postgres databases. I've defined them in the DATABASES list on settings.py as…
Diane Kaplan
  • 1,626
  • 3
  • 24
  • 34
0
votes
2 answers

How to insert multiple rows using node.js, db-migrate, postgres

I have a roles migrations. 'use strict'; var dbm; var type; var seed; /** * We receive the dbmigrate dependency from dbmigrate initially. * This enables us to not have to rely on NODE_PATH. */ exports.setup = function (options, seedLink) { …
Simon Nazarenko
  • 107
  • 2
  • 11
0
votes
0 answers

Node JS db-migrate for different database

I'm already using db-migrate package to migrate MySQL database script and it works well, I've even setup the DATABASE_URL variable in the server environment. Now I've a requirement to store few details in the sqlite in the same service, I checked…
FR STAR
  • 662
  • 4
  • 24
  • 50
0
votes
0 answers

How can I create tablespace for my postgres DB dynamically using flyway and java?

How can I create tablespace for my Postgres DB dynamically using flyway and java? Trying to create tablespace before executing SQL queries Flyway flyway =…
rohit kumbhar
  • 121
  • 1
  • 8
0
votes
1 answer

heroku rake db:migrate, rake aborted! undefined method 'task'

When i run: heroku rake db:migrate, I get this error message: rake aborted! undefined method 'task' for #<'Myapp::Application:0x7f07c011f4f8> I'm running rake 0.8.7 and have uninstalled rake 0.9. Also, when i add --trace, these files come…
0
votes
1 answer

Appending an array field, from another field, in MongoDB documents (with MongoClient) in Node.js

I have a collection called Users. Here is an example of a…
Ankit
  • 69
  • 1
  • 6
0
votes
1 answer

EF Core migrations on a new SQL Server

I'm trying to build a Migration console app, that is able to start from scratch, i.e. on a freshly installed SQL Server, including a dedicated user with credentials, which should be the db_owner. I have it working on PostgreSQL, but need to get a…
TheRoadrunner
  • 1,281
  • 14
  • 34
0
votes
1 answer

How to migrate a HUGE MySQL DB to PostgreSQL DB

I have SonarQube MySQL DB (450GB) running and I want to Migrate to PostgreSQL DB. I tried to migrate using MySQL-migrator (https://github.com/SonarSource/mysql-migrator), it takes long time and fails, we cannot RESUME as well. What is the simple and…
Mohan
  • 31
  • 1
  • 4
0
votes
1 answer

Using npm db-migrate with Elastic Beanstalk

I am trying to automate my Elastic Beanstalk deployment of a nodejs app that uses npm db-migrate. I have read the AWS docs for Customizing Software on Linux Servers it seems I should be using a container command. I created a file…
0
votes
1 answer

Is it possible to configure db-migrate to use a table not named migrations to keep track of migrations?

I want to use db-migrate. But my team wants to use the table name "migrations" for the project. I do not have authority to change that. Can I configure db-migrate to keep track of its database migrations in another table?
emory
  • 10,725
  • 2
  • 30
  • 58
0
votes
1 answer

Ruby on Rails 3 simple-navigation could not find in any of the sources

I've be using simple-navigation and it's working fine. I've just tried to do a database migration using: rake db:migrate and get the error: test me$ rake db:migrate (in /Users/me/test) Could not find simple-navigation-3.2.0 in any of the…
Mike Neumegen
  • 2,436
  • 1
  • 24
  • 39