database-schema

Duplicate schema name in sequence generation

☆樱花仙子☆ 提交于 2020-01-11 13:26:29
问题 To prevent the usage of the schema attribute in the table annotation to all of my entities, I set the default schema name by the schema.xml: <?xml version="1.0" encoding="UTF-8"?> <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_2_0.xsd" version="2.0"> <persistence-unit-metadata> <persistence-unit-defaults> <schema>X</schema> </persistence-unit-defaults>

How do I merge two similar database-schema in PL/SQL?

非 Y 不嫁゛ 提交于 2020-01-11 06:44:29
问题 The database-schema (Source and target) are very large (each has over 350 tables). I have got the task to somehow merge these two tables into one. The data itself (whats in the tables) has to be migrated. I have to be careful that there are no double entries for primary keys before or while merging the schemata. Has anybody ever done that already and would be able to provide me his solution or could anyone help me get a approach to the task? My approaches all failed and my advisor just tells

How to create alter script from two mysqldump files

余生长醉 提交于 2020-01-07 03:11:08
问题 I'm trying to figure out how to implement migration between two databases. My plan is Create mysqldump --no-data of source DB Create mysqldump --no-data of target DB Create alterscript based on 2 created mysqldump files Run alter script on target DB to migrate new changes However I haven't found a way to compare 2 mysqldumps and create alter script from that. Is there any tools for that? -kari 回答1: Looks like this tool does what I need. http://search.cpan.org/dist/MySQL-Diff/bin/mysqldiff I

Organize table avoiding redundancy

雨燕双飞 提交于 2020-01-06 19:51:34
问题 I'm trying to create a database to manage autobus data CREATE TABLE Company( Company_Name VARCHAR(12), Tel INT, PRIMARY KEY(Company_Name) ); CREATE TABLE Line( ID_Line VARCHAR(3), NCompany_Name VARCHAR(12), Desc TEXT, PRIMARY KEY(ID_Line, Company_Name), FOREIGN KEY (Company_Name) REFERENCES Company(Company_Name) ); CREATE TABLE Stop( ID_Stop VARCHAR(3), geoLat FLOAT(10,6), geoLong FLOAT(10,6), PRIMARY KEY(ID_Stop) ); CREATE TABLE Make( ID_Stop VARCHAR(3), ID_Line VARCHAR(3), Hour TIME,

Pros and Cons of different Schema designs for tables that all have a relationship to one data item

一世执手 提交于 2020-01-05 08:17:11
问题 I am developing a system that will have a database backend. I am intending that every table have a PK that is arbitary, system generated and maintained. My environment (for development and production) is Windows 7; Delphi; and an embedded database (probably Firebird). My data structures include one table OWNER, that has very little information associated with it - probably no more than name and description. The rest of the data structure will be about 50 tables, each with name and description

Populate with inherited document in Mongoose

江枫思渺然 提交于 2020-01-05 04:51:03
问题 I am trying to create a database schema for the following model: I am not sure what the better way to represent this in a MongoDb would be, but since I am using Mongoose and there is a plugin for inheritance, I am trying the following: var mongoose = require('mongoose') , extend = require('mongoose-schema-extend') , Schema = mongoose.Schema , ObjectId = mongoose.Schema.Types.ObjectId var db = mongoose.connection; db.on('error', console.error.bind(console, 'connection error:')); db.once('open'

SQLException on db:test:load with Rails

有些话、适合烂在心里 提交于 2020-01-04 06:55:09
问题 I've been working on a small but somewhat complex Rails application with multiple has_and_belongs_to_many relationships. It's open source, and the code is here. Everything was working fine, but recently I added a new HABTM relationship migration, and an rspec test started to fail. Rake:db:migrate was working (and the issue was working locally), just not in testing. Upon running db:test:load --trace , I get the following error: :fermi og$ rake db:test:load --trace /Users/og/.rvm/rubies/ruby-1

Error when SQL-querying flatfiles with custom file-extension

大兔子大兔子 提交于 2020-01-03 19:05:57
问题 I'm looking for a way to query flatfiles with custom file-extensions directly via SQL. Normally use something like SELECT * FROM [Text;DATABASE=C:\Flatfiles].[S7121070_ppis#csv] which works terrific with .txt, .csv and .tab. However, in my current project I work with fixed-width flatfiles with an .ftp7-extension. When querying those files in with VBA, I encounter Err# -2147217911, stating that the object or database is locked. Oddly, this occurs only whenever I querying anything that's not a

List all tables in cakePHP 3.x

最后都变了- 提交于 2020-01-03 15:37:17
问题 I have been trying to work this one out. In cakePHP 2 I could use: $tables = ConnectionManager::getDataSource('default')->listSources(); But in CakePHP 3.x I can't work out what to use? I have looked at the link cakephp get schema for list of tables Unfortunately it doesnt help with cakePHP 3.0? 回答1: We can get list of table in cakephp3 using very similar pattern as $tables = ConnectionManager::get('default')->schemaCollection()->listTables(); 回答2: I just had the same problem. Try using the

How to get columns Primary key constraints using SqlConnection.GetSchema()

陌路散爱 提交于 2020-01-02 03:20:10
问题 I have some code of ADO.NET to dynamically detect the database schema, what I need is how to get unique columns constraints and Primary key constraints using the GetSchema method on SqlConnection . This is the code that I have: conn.Open(); SqlCommand mSqlCommand = new SqlCommand("sp_pkeys", conn); mSqlCommand.CommandType = CommandType.StoredProcedure; mSqlCommand.Parameters.Add( "@table_name", SqlDbType.NVarChar).Value = tableName; SqlDataReader mReader = mSqlCommand.ExecuteReader(