data-migration

What is the exact location of MySQL database tables in XAMPP folder?

依然范特西╮ 提交于 2019-11-26 20:01:32
问题 I have a MySQL database and I want to know the exact location where this data actually stored in the XAMPP folder, I went to this file location to try to get the information: xampp -> mysql -> data -> Here I found a separate folder for each of my databases and within these folders I saw files stored with the .frm format (FRM FILE) . When I copied my desired database with all tables in .frm format and try to use them on another PC, I was given an empty database of the same name. Where are the

Loading initial data with Django 1.7 and data migrations

限于喜欢 提交于 2019-11-26 19:23:37
I recently switched from Django 1.6 to 1.7, and I began using migrations (I never used South). Before 1.7, I used to load initial data with a fixture/initial_data.json file, which was loaded with the python manage.py syncdb command (when creating the database). Now, I started using migrations, and this behavior is deprecated : If an application uses migrations, there is no automatic loading of fixtures. Since migrations will be required for applications in Django 2.0, this behavior is considered deprecated. If you want to load initial data for an app, consider doing it in a data migration. (

Insert data and set foreign keys with Postgres

半世苍凉 提交于 2019-11-26 18:26:10
问题 I have to migrate a large amount of existing data in a Postgres DB after a schema change. In the old schema a country attribute would be stored in the users table. Now the country attribute has been moved into a separate address table: users: country # OLD address_id # NEW [1:1 relation] addresses: id country The schema is actually more complex and the address contains more than just the country. Thus, every user needs to have his own address (1:1 relation). When migrating the data, I'm

Exporting data In SQL Server as INSERT INTO

拥有回忆 提交于 2019-11-26 14:48:39
I am using SQL Server 2008 Management Studio and have a table I want to migrate to a different db server. Is there any option to export the data as an insert into SQL script?? marc_s In SSMS in the Object Explorer, right click on the database, right-click and pick "Tasks" and then "Generate Scripts". This will allow you to generate scripts for a single or all tables, and one of the options is "Script Data". If you set that to TRUE, the wizard will generate a script with INSERT INTO () statement for your data. If using 2008 R2 or 2012 it is called something else, see screenshot below this one

SQL Server String or binary data would be truncated

China☆狼群 提交于 2019-11-26 13:03:25
I am involved in a data migration project. I am getting the following error when I try to insert data from one table into another table (SQL Server 2005): Msg 8152, Level 16, State 13, Line 1 String or binary data would be truncated. The source data columns match the data type and are within the length definitions of the destination table columns so I am at a loss as to what could be causing this error. IAmTimCorey You will need to post the table definitions for the source and destination tables for us to figure out where the issue is but the bottom line is that one of your columns in the

What is your favorite solution for managing database migrations in django? [closed]

青春壹個敷衍的年華 提交于 2019-11-26 12:02:49
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I quite like Rails\' database migration management system. It is not 100% perfect, but it does the trick. Django does not ship with such a database migration system (yet?) but there are a number of open source projects to do just that, such as django-evolution and south for example. So I am wondering, what

Dealing with schema changes in Mongoose

╄→尐↘猪︶ㄣ 提交于 2019-11-26 11:59:44
问题 What\'s the best practice (or tool) for updating/migrating Mongoose schemas as the application evolves? 回答1: Update: Tested, this does not work in its current form, its got the right idea going, I got a single migration to work with considerable tweaking of the module itself. But I don't see it working as intended without some major changes and keeping track of the different schemas somehow. Sounds like you want mongoose-data-migrations It is intended to migrate old schema versions of your

Loading initial data with Django 1.7 and data migrations

徘徊边缘 提交于 2019-11-26 06:57:11
问题 I recently switched from Django 1.6 to 1.7, and I began using migrations (I never used South). Before 1.7, I used to load initial data with a fixture/initial_data.json file, which was loaded with the python manage.py syncdb command (when creating the database). Now, I started using migrations, and this behavior is deprecated : If an application uses migrations, there is no automatic loading of fixtures. Since migrations will be required for applications in Django 2.0, this behavior is

How to group by week in MySQL?

北城余情 提交于 2019-11-26 04:19:14
问题 Oracle\'s table server offers a built-in function, TRUNC(timestamp,\'DY\') . This function converts any timestamp to midnight on the previous Sunday. What\'s the best way to do this in MySQL? Oracle also offers TRUNC(timestamp,\'MM\') to convert a timestamp to midnight on the first day of the month in which it occurs. In MySQL, this one is straightforward: TIMESTAMP(DATE_FORMAT(timestamp, \'%Y-%m-01\')) But this DATE_FORMAT trick won\'t work for weeks. I\'m aware of the WEEK(timestamp)

Exporting data In SQL Server as INSERT INTO

岁酱吖の 提交于 2019-11-26 04:02:10
问题 I am using SQL Server 2008 Management Studio and have a table I want to migrate to a different db server. Is there any option to export the data as an insert into SQL script?? 回答1: In SSMS in the Object Explorer, right click on the database, right-click and pick "Tasks" and then "Generate Scripts". This will allow you to generate scripts for a single or all tables, and one of the options is "Script Data". If you set that to TRUE, the wizard will generate a script with INSERT INTO () statement