I am facing some problem with sequelize while i keep {force: true} . In this case old data dropped and new database is created and my saved data get lost. I want to create new database with old values. Can that possible with sequelize in node.js
When you have database with some data and want to make some changes in db you have two possibilities:
as you said recreate db, but this will drop tables (erase your data).
use migrations (you can read about it here)
Migrations allow you to to don't loose your data and instruct sequelize how to change tables.
There is ticket for recreating tables with alter tables instead of drop tables here
Related
using jhipster I have created Angular based Monolith application (MySQL) and loaded jdl file, everything is working fine. But by mistake I have dropped MySQL database schema. Now I have recreated the database schema, but now when I run ./mvnw, it is not creating the database tables and entries any more even the login and authentication tables were also not created? Is there settings change I need to make to recreate the database all the database tables?
Liquibase does not create the schema, it creates tables, indexes, ... but only in a pre-existing database/schema. You must re-create your schema.
You can create schema from liquibase, but not a database, so you must just create database, and for schema you can use this:
<sql> CREATE SCHEMA yourSchema </sql>
I can smoothly connect my MySQL database to Superset and create a table, slice and dashboard, but when I add a new column in the table in MySQL, the table I created in Superset would not change or refresh the schema.
In order to solve the problem, I have to delete the old tables, slice and dashboard and connect again to rebuild them, which doesn't make sense.
Is there any way I can refresh schema in superset when table schema in MySQL is modified?
Superset v. 1.0.0
postgreSQL
when schema is changed, just refreshing the schema in table edit won't add the new columns. You have to click:
I want to migrate from mysql to postgresql to improve my data's control but I found several problems:
I have two applications that can only be run over mysql and a new
aplication that I want to migrate to postgresql.
I need to redesign several parts of the old database (mysql) and
apply the new design in the new database (postgresql).
If I insert a new row in some tables of old database, this row
should be synchronized to the new database with the new design
For doing this, I've been thinking to use a data wrapper, and synchronize data using triggers( I only need to synchronize data in one way (mysql to postgresql)).
Do you think that's a good choise to solve this problem?
Any ideas/advise?
I have two database, each contain different tables
leave.sql and crm.sql
I want to transfer all my leave tables into the crm database
How should I do it?
If the other database has different tables then the leaves database then all you need to do is import the data into the crm database. Finally, make sure your leaves script is connected to the new crm database.
Two other methods:
On the mysql prompt, you can rename your tables - and effectively move them from one database to the other (if both are on the same filesystem):
From http://dev.mysql.com/doc/refman/5.0/en/rename-table.html:
As long as two databases are on the same file system, you can use
RENAME TABLE to move a table from one database to another:
RENAME TABLE current_db.tbl_name TO other_db.tbl_name;
If you are using MyISAM tables, and you have root privileges, you can just do:
stop your mysql server
move your tables from the old database directory to the new one
start your mysql server
All those assuming the tables in your old database (the ones you want to move) have different names than the ones in your new database (the ones you want to keep). If that's not true, you'll also have to change the names.
I have a wordpress instance running on my localhost. In order to move this to another server, I'd like to export the contents of this database to an sql file. However, I don't have the permission to create new databases, I have an existing database in which I'd like to insert the tables and all the rows inside them. Is there a way to tell phpmyadmin to export the data in such a way that everything will be inserted into this new database? Or would it be better to just do a find/replace inside the sql file?
In fact, if you select the database in phpmyadmin, it shows all the tables contained. If you choose to export at that stage, it will export by default (actually depends on its version) all the tables structure and data without database creation. Additionally, it does give you the option of exporting only the data.