data-migration

PGSQL - Joining two tables on complicated condition

北战南征 提交于 2019-12-11 18:54:48
问题 I got stuck during database migration on PostgreSQL and need your help. I have two tables that I need to join: drzewa_mateczne.migracja (data I need to migrate) and ibl_as.t_adres_lesny (dictionary I need to join with migracja). I need to join them on replace(drzewa_mateczne.migracja.adresy_lesne, ' ', '') = replace(ibl_as.t_adres_lesny.adres, ' ', ''). However my data is not very regular, so I want to join it on first good match with the dictionary. I've created the following query: select

Unpivot dynamic table columns into key value rows

这一生的挚爱 提交于 2019-12-11 15:47:46
问题 The problem that I need to resolve is data transfer from one table with many dynamic fields into other structured key value table. The first table comes from a data export from another system, and has the following structure ( it can have any column name and data): [UserID],[FirstName],[LastName],[Email],[How was your day],[Would you like to receive weekly newsletter],[Confirm that you are 18+] ... The second table is where I want to put the data, and it has the following structure: [UserID

How to transfer a structure from one Plone to another

假如想象 提交于 2019-12-11 11:25:37
问题 I have a Plone instance which contains some structures which I need to copy to a new Plone instance (but much more which should not be copied). Those structures are document trees ("books" of Archetypes folders and documents) which use resources (e.g. images and animations, by UID) outside those trees (in a separate structure which of course contains lots of resources not needed by the ones which need to be copied). I tried already to copy the whole data and delete the unneeded parts, but

Is there a way to easily change the server name on several SSIS packages programmatically?

瘦欲@ 提交于 2019-12-11 09:02:16
问题 We are creating several SSIS packages to migrate a large database as part of a release cycle. We may end up with about 5-10 SSIS packages. As we have 4 environments (dev, QA, staging, production, etc.), is there an efficient way to change the destination server for each SSIS package as they go through the different server environments? Ideally, there could be a script that is run that would take as a parameter the server that was needed. 回答1: You could use a configuration file to store the

Rails — understanding db:migrate

[亡魂溺海] 提交于 2019-12-11 03:17:45
问题 I am having a little trouble understanding migrations in Ruby on Rails. I have the following two classes in my application's db\migrate\ directory (stored in separate files): class CreateUsers < ActiveRecord::Migration def self.up create_table :users do |t| t.string :name t.string :email t.timestamps end end def self.down drop_table :users end end class AddEmailUniquenessIndex < ActiveRecord::Migration def self.up add_index :users, :email, :unique => true end def self.down remove_index :users

Django/Python: How to iterate through a list in a dictionary for migration/migrate data

徘徊边缘 提交于 2019-12-10 22:30:59
问题 I’m trying to set up migration files to load values into my tables. I am creating countries/states in my tables. I would like to set it up in a way that I can put each country in its own file, and then run through all the countries on migration. I successfully got all the names in separately, but I’m trying to make it easier. UPDATE: Thanks for help, I got it all to work the way I want it to. Here is my end result. models: class Country(models.Model): country_code = models.CharField( primary

Import oracle dump to PostgreSQL

99封情书 提交于 2019-12-10 19:59:46
问题 I have a plain text not oracle binary dump. How can I import this to postgres? Are there tools available for this out there? Or is there some other one, anyone did this before? What I though is to convert one dump (oracle) into another dump (postgres). 回答1: Check out ETL tools like Talend and Pentaho for conversion between Oracle and PostgreSQL. From an Oracle dump it's going to be much more difficult. Your best bet is almost certainly to load it into an Oracle instance and then use migration

Opening Paradox database; 'PDOXUSRS.NET' workaround?

非 Y 不嫁゛ 提交于 2019-12-10 19:33:33
问题 I'm writing an application that has to open a preexisting BDE database that has been saved by a third party. In this application, I currently have a TDatabase ( DriverName : STANDARD ) with path set correctly in Params . I can now set Connected to true without an error message. There is also a TTable with DatabaseName set to the values of the TDatabase and TableName set to the .db-file that lies in the folder (the name was automatically filled in, I only hat to select it). Now the problem: If

Can't find mapping model for migration, where does the mapping model have to go?

非 Y 不嫁゛ 提交于 2019-12-10 17:49:07
问题 I have a project that uses CoreData on iOS and we have gone through numerous model updates with the lightweight migration technique and the NSInferMappingModelAutomaticallyOption set to YES. This works perfectly fine, but for the current transition we need to specify some more information and thus create a mapping model. I created the mapper by going to File->New and create a new data model mapper that maps the old version of my model to the new version. The mapper is in the Resources folder

How to update a TIMESTAMP column to TIMESTAMP WITH TIME ZONE in Oracle

好久不见. 提交于 2019-12-10 13:50:14
问题 I have a pair of columns that were unfortunately defined incorrectly as TIMESTAMP(6) instead of TIMESTAMP(6) WITH TIME ZONE . I would like to migrate those columns from the old, wrong datatype to the new, correct one. On top of that, the values appear to have been captured in E(S|D)T and I need the value in UTC. So far, the best I've got is: alter table OOPSIE_TABLE add ( NEW_COLUMN_A timestamp(6) with time zone, NEW_COLUMN_B timestamp(6) with time zone ); update OOPSIE_TABLE set NEW_COLUMN_A