Coder Social home page Coder Social logo

Comments (12)

spotman avatar spotman commented on May 17, 2024

+1 for this feature!

from dbv.

tarciozemel avatar tarciozemel commented on May 17, 2024

+1

from dbv.

rexli avatar rexli commented on May 17, 2024

+1 , it is very useful I believe.

from dbv.

jpSimkins avatar jpSimkins commented on May 17, 2024

+1

from dbv.

mastilver avatar mastilver commented on May 17, 2024

Is someone working on this feature?

What I would recommend is to add these methods to the adapters interface:

/**

  • return an array that contains all the primary keys of a table
  • @example for table 'comment' return array('idArticle', 'idAuthor')
  • @param string $name the name of the table
  • @return string[]

*/
public function getPrimaryKey($name);

/**

  • return an array of SQL query to populate the given table name
  • @exemple for table 'comment' return array('INSERT INTO comment(idArticle, idAuthor, content) VALUES(1, 11, test)', 'INSERT INTO ...', ...)
  • @param string $name the name of the table
  • @return string[]

*/
public function getData($name);

We should as well add a .dbvignore file:

comment # do not save any data of the comment table
comment idAuthor = 10 # do not save comments posted by this user
comment idAuthor between 0 and 10
... etc

from dbv.

victorstanciu avatar victorstanciu commented on May 17, 2024

Hmm, so what you would need is a "snapshot" feature, that would save the current schema for each table, and that could then be compared with a more recent snapshot?

from dbv.

spotman avatar spotman commented on May 17, 2024

Exactly!
Also the ability of automated creating "sql-patches" between "snapshots" would be perfect.
With this feature we can create new versions without writing up SQL-queries (they may be generated automatically).

from dbv.

AlexDubstone avatar AlexDubstone commented on May 17, 2024

I installed dbv today and was hoping to have found a tool that does exactly that.
I install a plugin or change the configuration using the backend. I don't know what has changed in the database but it would be so neat if I could pass these changes to my team mates so they don't have to set the same configuration again. Is there any way this could be implemented?

from dbv.

unglud avatar unglud commented on May 17, 2024

I'm a new in bash scripting, but this can give you some ideas

#!/bin/bash

REVISION_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/data/meta/revision"
REVISIONS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/data/revisions/"
CUR_REVISION=$(cat "$REVISION_PATH")
CUR_REVISION=$(($CUR_REVISION+1))

NEW_REVISION="$REVISIONS_DIR"$CUR_REVISION/`date '+%Y-%m-%d'`.sql

mkdir "$REVISIONS_DIR"$CUR_REVISION

mysqldbcompare --server1 root:password@localhost:/tmp/mysql/mysql.sock test_dbv:test_dbv_2 --run-all-tests -d sql -a > "$NEW_REVISION"

I use mysqldbcompare util (http://dev.mysql.com/doc/mysql-utilities/1.3/en/mysqldbcompare.html) for generating and creating revision sql file. In my case I have 2 databases: test_dbv - remote DB and test_dbv_2 - local development DB. U can think about it like test_dbv - snapshot before starting any changes, and test_dbv_2 - it's snapshot after changes.

Workflow can look like this:

  1. pull from VCS
  2. update test_dbv from DBV control panel
  3. copy test_dbv to test_dbv_2
  4. change anything you like in test_dbv_2
  5. then invoke dbv/migrate.sh
  6. update test_dbv from DBV control panel
  7. commit/push

from dbv.

DevertNet avatar DevertNet commented on May 17, 2024

+1 !

from dbv.

Adoniasv avatar Adoniasv commented on May 17, 2024

+1

from dbv.

danbrellis avatar danbrellis commented on May 17, 2024

Any updates or thoughts on this feature? Not sure if you are still actively developing this project. Just curious. Thanks!

from dbv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.