schema

How to keep table structure up-to-date

Does anyone have an idea for a scipt that can check an array/XML of table definitions with the current database tables and make appropriate alter/create queries to synch them? I'm currently using php5 and mysql 5. ...

Derby - constraints.

In the Derby server, how can you use the information in the system tables of the schema to create a select statement in order to retrieve the constraint names for each table? ...

Same element, multiple types with XML Schema

I want to construct the following XML: <?xml version="1.0"?> <foo> <bar type="alpha"> <first /> <second /> </bar> <bar type="bravo"> <third /> <fourth /> </bar> </foo> The salient point being that I want "bar" to have different child elements depending on its type -- if the type is "alpha" then the children MUS...

Tables created by default in user schema

In Sql Server 2008, when I create a table without schema prefix: create table mytable ( id int identify ) it usually ends up in the schema dbo, with name dbo.mytable. However, on one of our servers, the tabel ends up belonging to me: andomar.mytable Which configuration difference could explain this? ...

How to organize common schemas referenced by multiple biztalk applications in a same group?

I have a situation were I need to reference a schema in two different BizTalk applications. I could either: Put the schema in one application and make the other applications have a reference to it. OR Put the schema in a common application and all other applications have a reference to this common application. However, in both the a...

Simplifying SQL Server's Logins/Owners/Schemas/Roles/Principals etc...

I frequently develop small internet applications using ASP.NET and SQL Server 2005. My databases are always only accessed by one application through an ASP.NET web service or something similar. When I'm developing an application and moving a database back and forth between my development computer (SQLExpress 2008) and hosted server (SQ...

Generating migrations from Rails schema updates, instead of the other way around

I hate writing migrations, but it's important for the schemas to stay in sync. What I'd much rather do is update my schema.rb and have Rails notice, then run something which generates the appropriate migration based on the difference between the old version and the current version. Is there a way I can do that? ...

How to compare MySQL database schemas

I am looking for a tool that will allow me to compare schemas of MySQL databases. Wich is the best tool to do that? ...

is there a strategy for creating proper database indexes?

Someone asked the question: "INT, BIGINT or UUID/GUID in Oracle, DB2, Derby and HSQLDB?" and I started to think about all the database schemas I've designed and the books that I've read and not one reference gave any real clear advice about creating indexes. For example; if you have a compound index like date() ++ foo() ++ bar() Whil...

How do you model custom attributes of entities?

Let's say we're having an application which should be able to store all kind of products. Each product has at least an ID and a Name but all other attributes can be defined by the user himself. E.g. He could create a productgroup Ipods which would contain attributes capacity and generation E.g. He could create a productgroup TShirts wi...

How to design DB table / schema with ease?

Is there a simple method to decide on what fields and indexes are needed for each table in an app you design? For example, if it is a webapp that simply lets people create lists (any number of lists, and users can create "things to do" list or "shopping" list), and the user can assign other users to edit the list, and whether the list i...

comparing data from mysql backups

I've got a few backups of my database, and I'm trying to figure out if there is a way to compare the data in the backups to see how the data as changed over time. I do not have a timestamp on the fields I want to compare, but I do have a unique id on the row. The backups are .sql files created by using mysqldump. Is there a process fo...

NHibernate "database" schema confusion [.\hibernate-mapping\@schema]

I'm using NHibernate primarily against an MSSQL database, where I've used MSSQL schemas for the various tables. In my NH mapping (HBM) files, I've specified the schema for each table in the mapping as follows: <?xml version="1.0"?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" auto-import="true" ...

XSD key/keyref: hierarchical key structure

I'm trying to define some foreign key constraints on an XML schema using xs:key and xs:keyref definitions. I want the structure of the document to be hierarchical in the following way: <?xml version="1.0" encoding="UTF-8"?> <tns:root xmlns:tns="http://www.example.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLoca...

Why can't Eclipse resolve the spring-dwr schema?

Eclipse is showing the following errors in my Spring's applicationContext.xml: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dwr:configuration'. myappservlet-servlet.xml MyApp/src/main/webapp/WEB-INF line 23 XML Problem cvc-complex-type.2.4.c: The matching wildcard is strict, but...

ORACLE 7.3 user management

Hi, At work I have an app sitting on Oracle 7.3 (old stuff, yes). Recently I tried to create an account that would be able to SELECT on all tables, but nothing else i.e. no updates or deletes. But whenever I create a new account it already has access to all application tables. I even stripped it down to CREATE SESSION only. This didn't ...

How can I validate documents against Schematron schemas in Java?

As far as I can tell, JAXP by default supports W3C XML Schema and RelaxNG from Java 6. I can see a few APIs, mostly experimental or incomplete, on the schematron.com links page. Is there an approach on validating schematron in Java that's complete, efficient and can be used with the JAXP API? Thanks ...

Fastest way to script generation SQL server DB schema for hashing

I'd like to ge the whole SQL schema for a DB, then generate a hash of it. This is so that I can check if a rollback script returns the schema to it original state. Is there a SP I can use or some other cunning method? I'd like it to be as fast as possible. ...

XML data structure like 'Multiple selection'

Hello. I wonder how i could easily describe Multiple selection combobox using XML and Schema. Currently iam using this definition: <xs:element name="RefPartner"> <xs:complexType> <xs:attribute name="isSalesRepresentative" type="xs:boolean"/> <xs:attribute name="isPolicyResponsible" type="xs:boolean"/> <xs:attribute name="isPolic...

Using @Table with schema name in Hibernate 3.3.1ga and HSQLDB

How can I make this work in unit tests using Hibernate 3.3.1ga and HSQLDB: @Entity @Table(name="CATEGORY", schema="TEST") public static class Category { ... } The problem is that Hibernate expects the schema to exist. The second problem is that Hibernate issues the CREATE TABLE TEST.CATEGORY before any of my code runs (this happens de...