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

Postgres :script to copy schema from internal server to deployment server ; without entering passwords at every step

I want to copy my database schema (just schema ;not data) from internal server to external server. The problem I am facing is entering passwords at every step. Even though the steps to copy are pretty simple, I am not able to generate a script to…
phoenix
  • 717
  • 1
  • 8
  • 26
0
votes
0 answers

CFWheels DbMigrate

I'm following the process here: http://cfwheels.org/screencasts/view/1 I put the zip file in my localhost/wheelstest/plugins folder. I get Could not find the ColdFusion component or interface wheelstest.plugins.cfwheels.cfwheels. Running apache with…
abalter
  • 9,663
  • 17
  • 90
  • 145
0
votes
3 answers

Problem with rake db:migrate

When I try rake db:migrate, I get the following error: !!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql. rake aborted! no such file to load -- mysql And when I try to "gem…
Shreyas
  • 8,737
  • 7
  • 44
  • 56
0
votes
1 answer

Migrating mysql db to heroku for web deployment

Following on from this question, I have deployed my php scripts successfully to heroku. Now I am having another doubt: How can I insert my local mysql db into heroku server? On my local machine, I usually launch my db on wamp server and call…
stretchr
  • 615
  • 2
  • 9
  • 24
0
votes
2 answers

Grails DB Migration - how to change decimal db field to have scale property of 3?

In order to change the decimal field I have in my table, I need to know how to have a DB migration code to have this change. Currently the field is represents as (19,2) and need to changed to (19,3) with 3 floating digits after the point. My…
roeygol
  • 4,908
  • 9
  • 51
  • 88
0
votes
1 answer

Create new table with data from Wordpress wp_postmeta table

The goal is to migrate the data related to a product definition stored in a Wordpress table (in this case, credit cards). Here is an example of the data I want to migrate: SELECT meta_key, meta_value FROM wp_postmeta WHERE post_id =…
rfc1484
  • 9,441
  • 16
  • 72
  • 123
0
votes
1 answer

Migrate Sqlalchemy schema from mssql to sqlite db?

I have all my table classes written for mssql but now I want to test my application locally so I need sqlitedb.Is there a way through which I can Replicate my database in sqlite. I am facing some issues like sqlite does not support Float as a…
Anurag
  • 180
  • 1
  • 12
0
votes
1 answer

Build db:rake task from existing Database

I have a project that has had alot of editing to the postgresql database. I am tring to find out is there a way to build a new db:rake file so i can rebuild the database on new server easily. Without manually editing the db:rake files. thanks Ruby…
Big Al Ruby Newbie
  • 834
  • 1
  • 10
  • 30
0
votes
2 answers

Delete a resource created with scaffold in Ruby on Rails

How can I delete a resource created with the scaffold command in Ruby on Rails? If I try to overwrite it, I have problems to migrate because the table already exists!
Seba92
  • 446
  • 1
  • 4
  • 17
0
votes
0 answers

Error occurs when I Migrate the database using Rake; db:migrate command results to NoMethodError;

using ruby version : 1.9.3 config/database.yml: # SQLite version 3.x # gem install sqlite3 # # Ensure the SQLite 3 gem is defined in your Gemfile # gem 'sqlite3' development: adapter: sqlite3 database: db/development.sqlite3 pool:…
The Third
  • 785
  • 2
  • 10
  • 30
0
votes
0 answers

Entire schema not availabe with API call

I have a class where I'm not getting the entire schema from the GET API call. My schema.rb: create_table "jumpsquares", force: true do |t| t.string "name" t.integer "apptype" t.string "url" t.string "ipordns" t.text "description" …
Kenny Coleman
  • 186
  • 1
  • 13
0
votes
2 answers

Adding Unique Modifier to an already existing model in Rails4

So I've created a model named User and email has been required on it, but I'd like to make that unique before I potentially deploy my app. I'm extremely new to rails but I've looked around for this scenario and I've only found things that allow you…
Brad Cypert
  • 671
  • 1
  • 8
  • 29
0
votes
1 answer

Yii migrations for altering tables

In my web application I have made some changes in the mysql database and I want to reflect the same changes in my web application. I know I can use database migration, but where should I run the command for a migration ? should I create a program…
user2492854
  • 401
  • 2
  • 12
  • 32
0
votes
2 answers

Rails Locally Installing Rails Application rake db:migrate returns

I have a private Rails app that I'm trying to install locally. It's currently running in a hosting environment but I'd like to install it locally to begin making changes. I've already worked out that I can make deploy updates to the 'live' server…
Shawn
  • 633
  • 1
  • 6
  • 13
0
votes
1 answer

Grails DB Migration Plugin - Weird Behaviour

I just came across a weird behavior while running dbm-update. It created two sets of databasechangelog and databasechangelock tables. One set with all Upper case and second with all lower case. The last update went only in the newly created log. It…
Abhay
  • 59
  • 2
  • 6