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
votes
1 answer

How to efficiently copy MySQL databases

Is there any other way to copy MySQL databases from one computer to the other, except importing each and every database individually? Actually in my office PC there seems to have a problem, so they are changing all the PC's in the office. My MySQL…
-1
votes
1 answer

When I try to do a rake db:migrate

Hello developers I am in trouble When I try to do a rake db:migrate it returns a warning but it doesn't seems to do the migration. This is the error: sanchez@danik21:/var/www/nubedianWebSite$ rake db:migrate DEPRECATION WARNING: You have Rails…
-2
votes
1 answer

Error executing SELECT * FROM "migrations_state" WHERE "key" = ?: No value specified for parameter 1. db-migrate

[Container] 2021/09/30 02:06:18 Running command db-migrate up Initializing driver... creating table: migrations_state Error executing SELECT * FROM "migrations_state" WHERE "key" = ?: No value specified for parameter 1. [ERROR]…
Akh
  • 11
  • 3
-2
votes
3 answers

mysql db enterprise upgrade from 5.5.42 to 5.7.11

All, Our product uses Mysql enterprise db. currently at 5.5.42 but planning to upgrade to 5.7.latest. What changes should I expect to see ? I'm interested in : 1) Performance impacts 2) Broken behavior 3) Changed behavior 4) Improvements --…
anjanb
  • 12,999
  • 18
  • 77
  • 106
-2
votes
1 answer

Ruby on Rails - Keep getting a error when trying to run "rake db:migrate"

I'm new to learning Ruby on Rails and when I run "rake db:migrate" in the command line I receive the following error: rake aborted! SyntaxError: >/Users/user_name/Sites/simple_cms/db/migrate/20140423221836_alter_users.rb:15: syntax >error,…
Kinan
  • 85
  • 1
  • 5
1 2 3
19
20