A description of the structure of the database - including the structure of the tables, columns, constraints, views, etc, etc... that make up the database.Normally defined in the text, generally SQL in an RDBMS, the schema describes the complete blueprint for the database, defining everything about the database except that data itself.
Questions tagged [database-schema]
2931 questions
1
vote
2 answers
Multi tenant database with customized schemas
I am writing a multi tenant application in which each tenant has their own schema in a database or their own database. Because the tenant data is separate I'd like to be able to customize their tables by adding columns, or by creating additional…

Sparafusile
- 4,696
- 7
- 34
- 57
1
vote
0 answers
EF always generating initial schema
I have been using EF 4.3.1 with much success. Today though as I update one of the tables the whole schema is getting generated instead of only the updated for the single table.
How can I prevent the whole schema from generating?
I have seen this…

Jawahar
- 183
- 4
- 16
1
vote
1 answer
How to TRUNCATE all tables from aspnet schema?
I've been doing alot of testing with my new MVC App and now I'm ready to move on to a new phase of development.
I would like to TRUNCATE all my aspnet generated tables, but I can't seem to figure out the order to remove all the foreign key…

mawburn
- 2,232
- 4
- 29
- 48
1
vote
2 answers
Which NLS_LENGTH_SEMANTICS for WE8MSWIN1252 Character Set
We have a database where the character set is set to WE8MSWIN1252 which I understand is a single byte character set.
We created a schema and its tables by running a script with the following:
ALTER SYSTEM SET NLS_LENGTH_SEMANTICS=CHAR
Could we…

timmy
- 1,752
- 6
- 23
- 35
1
vote
1 answer
Database Design and flattening composite primary keys
I'm building a claims database with the above schema so far. Three three-part key on tblPatient is to uniquely identify individual's claim for a certain problemX. The same patientID can appear in tblPatient as long as the admission/discharge…

wootscootinboogie
- 8,461
- 33
- 112
- 197
1
vote
0 answers
How do I set user in delayed job
I'm running a rails function as a delayed job. The problem is the session info that I had in place doesn't come across to the delayed job (I didn't expect it would).
So my user is logged in and that log-in tells rails what postgres schema to hit.…

baash05
- 4,394
- 11
- 59
- 97
1
vote
1 answer
Building a many-to-many db schema using only an unpredictable number of foreign keys
Good afternoon (at least around here),
I have a many-to-many relationship schema that I'm having trouble building. The main problem is that I'm only working with primary and foreign keys (no varchars or enums to simplify things) and the number of…

user1449855
- 1,195
- 2
- 10
- 14
1
vote
1 answer
How do I configure Schema Compare to produce separate files for foreign keys?
To work with our database project in VS 2010, we make schema changes directly into our local project database using SSMS, then when we are ready to check in we do a Schema Compare, the local database vs the project, which identifies our changes. …

Mike K
- 1,313
- 2
- 18
- 28
1
vote
2 answers
Datetime and Integer functions on Varchar fields
We are refactoring a weird system where within its backend, values that should be stored as number and date columns, with propperly designed constraints, were stored all as varchar (using only UI validation). The thing is, while we do this the new…

Erre Efe
- 15,387
- 10
- 45
- 77
1
vote
1 answer
How should I design my model/viewmodel for this application?
I'm working on a web application using ASP.Net-MVC3 on II6 with SQL Server 2008. I can't give details about the project so let's say for the purposes of this question it's for a library. There are Books and people can Check Out these Books. We want…

Manual5355
- 981
- 10
- 27
1
vote
2 answers
Simple Photo Sharing Site: How to structure the MySQL database for multiple users and their photos
I am a high school student learning PHP and MySQL. I am trying to create a simple photo sharing site that allows a user to sign up and start uploading images. Each user has a profile that shows all of their pictures.
I currently only have one table,…

NewtoPHP
- 11
- 2
1
vote
2 answers
What are the common ways to manage database versioning in a .NET/SQL Server environment?
Let's say I create a new column on a table on my local database copy for testing some new functionality, and I want to eventually merge these changes into an internal testing environment and ultimately production level environment? Up until now this…

whoblitz
- 1,065
- 1
- 11
- 17
1
vote
1 answer
Visio Database Design - Unsure of additional Foreign Keys added by Visio
Please see the following example Database Model i made to help visualize my problem:
In this example, the relationship between car and history is 1 to zero or more and relationship between car and options is 1 to zero or more.
both tables have car…

ke3pup
- 1,835
- 4
- 36
- 66
1
vote
2 answers
"Weekly Top 10" Database Design Issue
I am working on a video site. It's pretty heavy so far as traffic is concerned. I am trying to rank videos by the number of times videos are viewed. I.e. video A gets 5.2K views and B gets 5k views, so A ranks above B. But I want to calculate the…

abhisek
- 924
- 1
- 13
- 27
1
vote
3 answers
Which Red Gate tool should I use?
I need to export/update schema without loosing existing data. I found that there are two Red Gate tools which you are probably have heard about:
SQL Compare;
SQL Data Compare;
Which one of them could help me to solve migration?

lexeme
- 2,915
- 10
- 60
- 125