database-schema

Firebase: how to efficiently track user/record change history

亡梦爱人 提交于 2019-12-08 19:14:37
问题 [ Lots of discussion about this on SO, but almost all dealing in SQL, so a lot of it is N/A to my question as far as I could tell ] i'm writing a CRUD app with react / redux , a firebase backend, & AWS lambda functions where necessary. My users will be interested in seeing what's been changed and when in their records, but I'm struggling with an efficient way to do this. My current plan is to maintain a collection of "record updates" records with fields like previousVal , changeDate , and

using schemas in postgresql

六眼飞鱼酱① 提交于 2019-12-08 17:22:45
问题 I have developed an application using postgresql and it works well. Now I need to create several instances of the same application but I have only one database. So I am thinking about using schemas, so that I can group each instance tables in a different schema. Now, I wouldn't like to rewrite all my functions and script, thus I am wondering if I can just use some directive to instruct the database to operate on a specific schema. Just to try to make it clearer, do you know when in c++ you do

Mysql create a single table name for the same schema type multiple tables

心已入冬 提交于 2019-12-08 13:46:45
问题 I was creating 10 tables with same schema for loading application LOG. I was creating 10 tables with same schema and at the end I do create a alias name which will represent all those 10 tables. So it take care about current active table selection to insert the records, so once table1 gets filled more records it will choose table2 and next table3.... So while selecting a record, it will check all the 10 tables for the requested record..... Now my question is, I forgot about how did I created

Firebase: structuring data via per-user copies? Risk of data corruption?

扶醉桌前 提交于 2019-12-08 13:37:32
问题 Implementing an Android+Web(Angular)+Firebase app, which has a many-to-many relationship: User <-> Widget (Widgets can be shared to multiple users). Considerations: List all the Widgets that a User has. A User can only see the Widgets which are shared to him/her. Be able to see all Users to whom a given Widget is shared. A single Widget can be owned/administered by multiple Users with equal rights (modify Widget and change to whom it is shared). Similar to how Google Drive does sharing to

Advanced filter in SQL

僤鯓⒐⒋嵵緔 提交于 2019-12-08 10:20:32
问题 I have a problem with filtering in my SQL. Please take a look at the schema of database. Now, I'd like to get programmers who know PHP with skills ●●/●●● and Java with skills ●●●. I executed following query: SELECT p.name, p.city FROM programmers p INNER JOIN skills s ON p.id = s.programmer WHERE ( s.lang = 'PHP' AND s.level > 1 ) OR ( s.lang = 'Java' AND s.level = 3 ); What I got is Joshua, Atlanta (because Java = 3) Joshua, Atlanta (because PHP > 1) Christopher, Chicago (because PHP > 1)

What is a good approach in creating a non-NoSQL, relational multi-schema database?

╄→гoц情女王★ 提交于 2019-12-08 09:09:48
问题 Consider a situation where the schema of a database table may change, that is, the fields, number of fields, and types of those fields may vary based on, say a client ID. Take, for example a Users table. Typically we would represent this in a horizontal table with the following fields: FirstName LastName Age However, as I mentioned, each client may have different requirements. I was thinking that to represent a multi-schema approach to Users in a relational database like SQL Server, this

Cassandra Database Data Model: Critic my schema design

こ雲淡風輕ζ 提交于 2019-12-08 07:22:50
问题 I need to implement a database for a testing system. It is designed to store test data for future statistical analysis. It has to be Cassandra based. I've designed a schema, but since this is my first attempt at NoSQL design, I would like to get some feedback. I will first describe the data I wish to save, then describe two basic queries and finally present my suggested design. I intend on using Cassandra 1.1 so I tried to use Composite Columns in my design, however, feel free to suggest

How to insert relational data (many to many) in SQL Alchemy by means of API queries in Python

回眸只為那壹抹淺笑 提交于 2019-12-08 01:48:29
问题 EDIT: I have made a short question because I think this one is too long, sorry First of all, I am a newcomer to databases, programming languages and so on... so sorry if this question is not so proper nor specific, any help or guidance would be much appreciated... The context I am working with is the following: I am querying an existing database by means of its APIs in order to retrieve certain information to design my own database. The point to create this database is for example to let the

Elegant schema to log users' actions

元气小坏坏 提交于 2019-12-07 22:12:18
问题 I have a database schema to log operations users perform in my webapp: Log --- Id Log_Type_Id Performed_by_Person_Id Performed_to_Person_Id Comment_Id Story_Id Photo_Id etc_Id Person_Log ---------- Person_Id Log_Id This way I can notify users of entries in their log with details about what exactly happened. The problem is the Log table has to contain every possible type of user operation (they modified a story or comment, created a story or comment or photo, updated a profile, etc). And

Search column name having specific value in tables in certain database

好久不见. 提交于 2019-12-07 12:32:34
问题 Is there any way I can search a column having specific value I am trying to find through all tables in a database? For example I have SELECT t.name AS table_name, SCHEMA_NAME(schema_id) AS schema_name, c.name AS column_name FROM sys.tables AS t INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID WHERE c.name LIKE '%VersionID%' ORDER BY schema_name, table_name; Which I found from searching. It gives me the table names that "versionID" column exists, but how can I search to return table names