database-migration

Use the ColumnAttribute or the HasKey method to specify an order for composite primary keys

大憨熊 提交于 2020-01-10 07:52:21
问题 I'm trying to use composite primary key on 2 objects with parent-child relationship. Whenever I try to create a new migration, I get an error: Unable to determine composite primary key ordering for type 'Models.UserProjectRole'. Use the ColumnAttribute or the HasKey method to specify an order for composite primary keys. As per error suggests, I do add annotation Column (Order = X) but the error still there and does not go away, unless I leave only one field with Key annotation. Here is my

Windows 10 PDOException with message 'could not find driver' Laravel 5.6.33 Wampserver 3.1.7 x86

本秂侑毒 提交于 2020-01-07 09:19:50
问题 I know there is a lot on this topic around StackOverflow, but my problem is that i have php extensions already uncommented, i have made the required changes to database.php and .env and i have declared and used the necessary environment path. The only thing i haven't done is install composer due to my proxy restrictions. I have a proxy that is over a kerberos windows AD, and for some reason nothing that used to work with proxy address, port and credentials (user and password) is working

MIgrating Virtual Columns from oracle to postgres

强颜欢笑 提交于 2020-01-07 02:18:15
问题 What options does one have to deal with virtual columns when migrating from Oracle 11 to Postgres 9.5 - without having to change database related code in an application (which means functions and views are out of the picture and triggers are way too expensive as dealing with large data sets)? A similar question exists : Computed / calculated columns in PostgreSQL but the solutions do not help with the migration scenario. 回答1: If you use a BEFORE INSERT trigger, you can modify the values

What is the best practice for data conversion between applications [closed]

限于喜欢 提交于 2020-01-07 02:16:07
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I wonder if this might be a too subjective question for stackoverflow but ill give it a go anyway. Is there a common/best practice for

Transform data using c# during Entity Framework migration

故事扮演 提交于 2020-01-06 03:10:07
问题 Is it possible to transform data stored in a column using a calculation performed in c# during an Entity First database migration? Currently, I have a column named Content of type nvarchar . I'd like to replace it with a column named ContentBinary of type varbinary , copying the content of each row in the process, but also transforming the content. Specifically, I want to convert the string to a UTF-8 encoding and then compress it. I know that the DbMigration class allows for transformation /

Migrating Access Tables to SQL Server - Beginner

妖精的绣舞 提交于 2020-01-05 11:21:20
问题 I'm working in an Access 2007 database and need help migrating tables to SQL server. Is this possible to do having only purchased Access 2007 or do I need to download a separate program for SQL? When I try to create a new SQL database or open an existing one through Access, I'm getting a "CREATE DATABASE" or "CREATE TABLE" error and not sure what the issue is. Any advice would be greatly appreciated! 回答1: Take a look at the microsoft's SQL Server Migration Assistant 2005 for Access (v4.0)

Neo4j: full-text lucene legacy indexes (node_auto_index) does not work after migration

萝らか妹 提交于 2020-01-05 04:18:12
问题 After successful migration from Neo4j 2.2.8 to 3.0.4 using official faq, full text search does not work as expected. Fuzziness is not that fuzzy as it was before. Example: START n=node:node_auto_index('name:(+Target~0.85)') MATCH (n) RETURN n; Should return nodes with field name that contain work like 85% similar to 'Target'. Before it was matching the following: Target Target v2 After migration: Target Why and how to fix that? 回答1: Reason was that after migration lucene node_auto_index wasn

Migrate data from PostgreSQL to MongoDB

╄→гoц情女王★ 提交于 2020-01-03 19:07:31
问题 I have to migrate 5 million records from PostgreSQL to MongoDb . I tried using mongify for the same but as it runs on ruby and I am not at all acquainted with ruby i couldn't solve the errors posed by it. So, I tried writing a code myself in node.js that would first convert PostgreSQL data into JSON and then insert that JSON into mongoDb . But, this failed as it ate a lot of RAM and not more than 13000 records could be migrated. Then I thought of writing code in Java because of its garbage

Cast JSON to HSTORE in Postgres 9.3+?

本小妞迷上赌 提交于 2020-01-03 16:00:36
问题 I've read the docs and it appears that there's no discernible way to perform an ALTER TABLE ... ALTER COLUMN ... USING statement to directly convert a json type column to an hstore type. There's no function available (that I'm aware of) to perform the cast. The next best alternative I have is to create a new column of type hstore , copy my JSON data to that new column using some external tool, drop the old json column and rename the new hstore column to the old column's name. Is there a

Laravel Migration - Adding Check Constraints In Table

大兔子大兔子 提交于 2020-01-01 08:43:57
问题 I want to create a table in Laravel Migration like this- CREATE TABLE Payroll ( ID int PRIMARY KEY, PositionID INT, Salary decimal(9,2) CHECK (Salary < 150000.00) ); What I have done is- Schema::create('Payroll', function (Blueprint $table) { $table->increments('id'); $table->integer('PositionID '); $table->decimal('Salary',9,2); //$table->timestamps(); }); But I can't create this- CHECK (Salary < 150000.00) Can anyone please tell, how to implement this CHECK constraints in Laravel Migration