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

Laravel Project - PhP Artisan not working as intended

I'm running a Laravel 9 project and everything was working fine. I was trying to get a migration i created to migrate into my data base and as i run the command: php artisan migrate i get the following error:…
0
votes
1 answer

Most efficient way to migrate a MySQL database while altering the primary key data type

Since MySQL 5.6 support is coming to an end next month, we are preparing for the migration. The DB is hosted on AWS Aurora. If we are to simply upgrade the engine to 5.7, we could do it online (RDS Aurora supports blue/green upgrade), or we could…
madu
  • 5,232
  • 14
  • 56
  • 96
0
votes
0 answers

Gems for rake DB

Good day What I have add to gem file ? And how install ? TODONE: added: gem 'rake', '0.8.7' run: > bundle install or run: > bundle install rake All it's not work Thank You **Gemfile** source 'http://rubygems.org' gem 'rails', '~>…
0
votes
0 answers

How to seed a test database with db-migrate

I am using the node module db-migrate for database migration. I am looking for a way to seed my test-database with some data, an ADMIN-user in my case, so that my tests can retrieve this entry. I know how to add an initial entry to my database via…
Luk
  • 1,009
  • 2
  • 15
  • 33
0
votes
1 answer

How to store a return value of an SQL query inside a variable

Given a users and a roles table, I want to write an SQL statement, which inserts a new row into the users table and associates a row of the roles table with it. This is what I have tried: INSERT INTO users(firstname, lastname) VALUES ('John',…
Luk
  • 1,009
  • 2
  • 15
  • 33
0
votes
1 answer

Intershop | dB migrate

"Address already in use" This is the error which I get while doing dbmigration, I have written the AddService and Addconfiguration properties file now wanted to do dbmigration and getting this error. How to fix this? Thanks in advance Tried to check…
0
votes
0 answers

How to drop a test database after having run all tests?

I am using the npm package db-migrate in my node-application to perform database migrations on a postgres database. I have an extra test-database, which I want to drop after having run all my tests. For this purpose, I added the following script to…
Luk
  • 1,009
  • 2
  • 15
  • 33
0
votes
1 answer

Connecting docker rethinkdb containers with existing rethinkdb and sync

I am running a docker container for rethinkdb. I want to load data from the existing rethinkdb database(running on a Linux machine) to the containerized rethinkdb empty clusters. I also want all the clusters to SyncUP and load with existing data.
Akhilesh
  • 89
  • 1
  • 6
0
votes
0 answers

Microsoft Enterprise Frame DB Migration errors: "Value cannot be null. (Parameter 'connectionString')" or

(Obligatory "I'm a novice and trying to learn" disclaimer here) I am attempting to complete an exercise to create my first API in Visual Studio 2022 (the default weather one doesn't count). The app is supposed to be to store notes. I've been chasing…
A Edwardo
  • 9
  • 3
0
votes
1 answer

nothing happen when i use db-migrate up command

Hi guys can you help me with my problem, somebody experienced db-migrate up for posgre here that nothing happens after using use command db-migrate up $ db-migrate up add-terminal-business-addr terminal screenshot Database config: { "dev": { …
Irish John
  • 11
  • 1
0
votes
0 answers

'ENV' is not recognized as an internal or external command,

I am trying to switch my environment on testing and migrate to a new database when running my test cases but I am getting the following error. I am using docker compose to build the image 'ENV' is not recognized as an internal or external…
Morpheus
  • 5
  • 5
0
votes
1 answer

Django migration gives psycopg2.errors.DuplicateTable: relation error

I have previously restored the database for the system, and while i tried to migrate through the django applicaion, the following error is thrown. What is the possible cause and how can we mitigate such cases. I guess the problem is with the…
hillsonghimire
  • 485
  • 5
  • 13
0
votes
1 answer

How to start Liquibase migrations before MyBatis mapping in a SpringBootApplication?

How to start Liquibase migrations before MyBatis mapping in a SpringBootApplication? Is it an official way for it? I tried DependsOn it doesn't work, exposing cyclic dependency
J.J. Beam
  • 2,612
  • 2
  • 26
  • 55
0
votes
0 answers

MODULE_NOT_FOUND error when running the dbmigrate command

I did the following: npm install --save sequelize-cli npm install -g db-migrate npm install sequelize-cli@2.1.0 --save When I run the dbmigrate command, I get the following error. What would be the reason? > PS…
Oscar
  • 11
  • 2
0
votes
0 answers

How to connect to my local posgres with db-migrate?

i'm trying the db-migrate library to handle migration for my application but i can't seem to figure out how to connect to my local postgres database. Here're my configs: (I'm using postgres v13 on ubuntu 20.14) // database.json { "dev": { …
Tom
  • 107
  • 7