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

db-migrate with @babel/register and ES6 modules - "SyntaxError: Unexpected token export" error

Really hoping someone can help me with this as it's driving me crazy. Node v12.4.0 package.json: - { "name": "@mypackage/db-migrate", "private": true, "version": "1.0.0", "main": "index.js", "license": "ISC", "workspaces": { …
U4EA
  • 832
  • 1
  • 12
  • 27
0
votes
1 answer

How to use ef6.0 to migrate the database to Oracle database fields that are generated in Upper

I used ef6.0 to migrate the database to Oracle, how to build a database field in Upper
0
votes
1 answer

db-migrate insert data from csv

I need to insert data in to my postgresql via db-migrate for my serverless app. So I have 4 table and each table has it's own csv data. Due to the number of record, I need to do it automatically, any advice? thanks
Anang M
  • 119
  • 8
0
votes
2 answers

db:migrate doesn't look like it can load part og my rake file

I am trying to run bundle exec db:migrate but get stuck with a load error: rake aborted! LoadError: cannot load such file -- sinatra/activerecord/rake/activerecord_6 I'm pretty sure this has to be a configuration error as the actuall code is from a…
0
votes
1 answer

Rails - Add relationship automatically on model

I have two models: class RecordProduct < ApplicationRecord end class ShopiTagProduct < ApplicationRecord end And I want to create a many to many relationship between models. I execute this command: rails g migration…
victorpacheco3107
  • 822
  • 3
  • 10
  • 32
0
votes
1 answer

How to change active record column type from boolean to integer without db:migrate?

I have a model like this: create_table :settings do |t| t.integer :user_id t.boolean :send_notification, :default => true end It was running well until I need to specify multiple types of notification (email and/or sms) and I want the…
Fajarmf
  • 2,143
  • 4
  • 19
  • 23
0
votes
1 answer

Copying data from non-production to production database

We are working on a project where we are moving from a old legacy system to a new system. So prior going live we do data compare between old system database and non-prod database(we enabled new potential production flow in the non-prod environment…
ATR
  • 2,160
  • 4
  • 22
  • 43
0
votes
0 answers

How to fix Rails Schema file being auto edit after rake db:migrate

We have always had some issues with rails schema file. It got worse after upgraded from rails 3 to rails 4.2. So everytime someone runs "db: migrate" on the local machine, it adds, removes or edit stuff in the schema file. Nothing got affected in…
0
votes
0 answers

grails database migration silently failing- how to figure out why

My last two changesets in changelog.xml are not getting executed on application startup. There are no errors in the log file, but when I look at the databasechangelog, I do not see the statements. Nor do I see the tables. (These are simple create…
Robin Trei
  • 91
  • 11
0
votes
1 answer

Unable to get records from atlas after migrate local mongo db into atlas

i migrate local db into atlas using following process export db collection one by one using mongoexport --db bla --collection usersettings --jsonArray --out ~/Desktop/users.json command import these collection on atlas using mongoimport…
Zombie
  • 404
  • 10
  • 18
0
votes
1 answer

error when use "rake db:migrate" on Ubuntu 16.04.5 LTS

I'm use "rake db:migrate" and getting this error message: Pls help me to fix that: # rake db:migrate rake aborted! StandardError: An error has occurred, this and all later migrations canceled: Directly inheriting from ActiveRecord::Migration is not…
Vượng
  • 3
  • 3
0
votes
2 answers

problem with migrating database on heroku

I got an error when migrating my database on heroku for my new rails app here's the error I got rails aborted! Gem::LoadError: Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? sqlite3 is not part of the bundle. Add it…
ELTA
  • 1,474
  • 2
  • 12
  • 25
0
votes
1 answer

How to downgrade Odoo 9 EE to CE?

I've Odoo 9 EE installed, and I wanna downgrade it to CE, so how can I do that ? I found this tutorial but I didn't get it working : https://www.quora.com/Can-we-install-enterprise-modules-in-Odoo-community-while-hosting-on-premise Thanks
BKF
  • 1,298
  • 4
  • 16
  • 35
0
votes
1 answer

Migration of SQL Server 2012 database to Oracle 12c

I'm trying to migrate a SQL Server 2012 database backup file, which I wanted to migrate to Oracle 12c. I tried to use SQL Developer tool for migration using this…
0
votes
1 answer

How to write migration script for a function in postgresql using a module node-pg-migrate

I am tring to write a migration script using node-pg-migrate module, but not able to succeed in it, as I am getting below error. Error: Can't get migration files:…
Jitendra Pawar
  • 1,285
  • 15
  • 27