Questions tagged [db-schema]

Use this tag for questions regarding the ER tool DbSchema. For questions regarding the schema definition in a database, use one of the [database-schema] or [database-design] tags.

An entity relationship modeling tool.

Homepage: https://www.dbschema.com/index.html

46 questions
53
votes
4 answers

Using Entity Framework 6 with Multiple DB Schemas but using One DBContext

I have an application using EF as ORM. The database used to have one schema, dbo and everything was working fine. I recently organized my tables into 4 different schemas. Some tables of one schema have dependencies on tables that reside on a…
Apollonas
  • 647
  • 1
  • 5
  • 12
36
votes
2 answers

DB Schema For Chats?

I need to store chat conversations in a database schema. The way I would use this database is I would post chats on a website. Each chat would not be more than about 20 responses. Can someone please suggest a schema for this?
Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062
24
votes
2 answers

DB Schema of a Role Based Access Control

I'm currently developing a member administration for a local association here and I'm developing the database schema at the moment. I'd like to share it with you to improve it and give other an example of a Role Based Access Model (RBAC). I'd…
sled
  • 14,525
  • 3
  • 42
  • 70
12
votes
3 answers

entity framework code first and database user

We're running into a small problem deploying a web application to another environment. We created the application's db using Entity Framework Code First approach (db automatic created from Model). In this development environment, we are using…
Ronald
  • 1,990
  • 6
  • 24
  • 39
8
votes
2 answers

Get all tables and all columns from a odbc database

I want to get all "table" names from a OdbcConnection, and for all "table" names I want to recieve all column names. So I came across the OdbcConnection.GetSchema() functionallity. I manges to get all the table names by simply using…
GameScripting
  • 16,092
  • 13
  • 59
  • 98
6
votes
2 answers

Relationships in Aerospike

I was wondering how one would represent relationships in Aerospike? I realize it's a Key-Value store but is there an example that can be given? For example: If have a user in the system and I want to get a list of Thing records associated with that…
seenickcode
  • 1,022
  • 1
  • 10
  • 18
5
votes
1 answer

In a JPA entity hierarchy using InheritanceType.JOINED, all relationships with subclasses results in foreign key constraints on the superclass table

I have the following JPA 2.0 Entities @Entity @Inheritance(strategy= InheritanceType.JOINED) public abstract class BookKeepingParent implements Serializable { @Id protected Long Id; ... } @Entity public class Employee extends…
4
votes
2 answers

Is using JPA/ORM to generate a db schema a bad idea?

Salve! Part of another question/answer on SO (as well as other statements claiming the same): if you are updating your database schema by JPA (generally not a good practice though) Is it true that you should not use a JPA implementation to…
user967058
  • 475
  • 6
  • 12
4
votes
3 answers

Users group table schema

I am creating a system where users can join and create groups. Within these groups, members can create topics and respond to topics already created, so I'd like to know your opinion on which of the following methods is best: Create two tables,…
jonathancardoso
  • 11,737
  • 7
  • 53
  • 72
4
votes
1 answer

How can I get a dbschema file of an existing sql 2005/2008 database?

there are two databases to compare,but I can't connect one database directly. so I want to compare the schema,then get a script to update one database. VS2010 can compare two databases by dbschema file. How can I get a dbschema file of an existing…
Sunny sun
  • 45
  • 1
  • 6
4
votes
1 answer

database design for online ordering system

While designing an online shop database I had a problem with one part, could please someone give me an advise whether it is designed ok? The idea is that there are products which can be assigned to categories. Each category has a set of parameters…
lekso
  • 1,731
  • 3
  • 24
  • 46
3
votes
1 answer

EF core and ASP.NET Core with a schema based multitenancy

I am building and App with ASP.NET core and EF core. I want to implement a schema based multitenancy using a single database. Each schema in my database will consist of the same set of tables with the same names, so all the schema share the same…
RTK
  • 223
  • 1
  • 6
3
votes
5 answers

Do 1 to 1 relations on db tables smell?

I have a table that has a bunch of fields. The fields can be broken into logical groups - like a job's project manager info. The groupings themselves aren't really entity candidates as they don't and shouldn't have their own PKs. For now, to group…
Dane O'Connor
  • 75,180
  • 37
  • 119
  • 173
3
votes
1 answer

How force pg_dump to (not) include scheme name for each objects in DDL

I need compare 2 DBs schemes (DDLs) - Postgress 9.5 Im executing below command on both servers: pg_dump -U postgres --dbname=db--schema-only -f schema.sql But I noticed one of output prefixes each objects by scheme name, eg CREATE FUNCTION…
Maciej
  • 10,423
  • 17
  • 64
  • 97
2
votes
1 answer

For financial data is it useful to index DATETIME?

Suppose I have a table STOCKCODE, DATETIME, PRICE I want to perform a basic query such as finding the maximum price between 12.00 PM and 3.00 PM on a given date for a given stock. Currently I index by: STOCKCODE, DATETIME, PRICE DATETIME is…
deltanovember
  • 42,611
  • 64
  • 162
  • 244
1
2 3 4