database-schema

Yii2: how to specify multiples database schemas?

走远了吗. 提交于 2021-02-20 04:51:10
问题 I am using PostgreSQL and the default database schema in my Yii2 application. I created a new schema called laboratory and I need to define it in the common/config/main-local.php file. This is my current main-local.php file: <?php return [ 'components' => [ 'db' => [ 'class' => 'yii\db\Connection', 'dsn' => 'pgsql:host=localhost;dbname=travel', 'username' => 'aaaa', 'password' => 'bbbb', 'charset' => 'utf8', ], ], ]; How can I add the laboratory schema in this file? I need both schemas. Is

SQL | Two Schemas Questions [closed]

一世执手 提交于 2021-02-17 07:17:10
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 days ago . Improve this question I'm new to the schema part of sql so trying to explore and have doubts on the following, there are two schemas S1 and S2 with table T1 in S1 and T2 in S2: If a user logins to S1 will he be able to the following: Access table T2 How will you grant access to T2

MySQL rejects column with ON DELETE SET NULL but not ON DELETE CASCADE

十年热恋 提交于 2021-02-10 13:26:23
问题 I have a simple MySQL database with some foreign keys on certain table columns. Some of the foreign key columns are set to ON DELETE SET NULL, and it seems to work fine. However, for one of the tables, I can't configure ON DELETE SET NULL - I can only configure ON DELETE CASCADE. The initial tables look like this: CREATE TABLE sessions( session_id int NOT NULL AUTO_INCREMENT PRIMARY KEY, name varchar(50) NOT NULL, UNIQUE KEY uk_sessions(name)) COLLATE utf8_unicode_ci; CREATE TABLE blocks(

Notification System Design

杀马特。学长 韩版系。学妹 提交于 2021-02-08 11:49:17
问题 Given the schema below, how can a notification system be incorporated? Users need to be notified when someone comments on their Picture or SaleItem along with when someone makes a bid on their SaleItem (through Purchase Offer). The ultimate goal is to have a notification system that will handle SMS, Email, and an internal system messaging system. The complexities of those options will be worked out but I need the basic data model from which they can be built upon. MySql is the DB being used

Laravel 3 Schema Table Column Collation

柔情痞子 提交于 2021-02-06 09:34:49
问题 I'm learning laravel, and I'm stuck on a simple process. I want the tables to be generated as UTF-8 but varchar and text fields are like latin-1. Schema section in guide did not help at all. I found this GitHub entry but it does not work neither (throws me errors). I have a schema like this: <?php class Create_Authors_Table { /** * Make changes to the database. * * @return void */ public function up() { Schema::create('authors',function($table){ //$table->charset('utf8'); //does not work //

Validate database schema in Hibernate 5

匆匆过客 提交于 2021-02-05 11:54:22
问题 Hibernate 4.x and 3.x has method Configuration#validateSchema that allows to verify that current database schema matches the object model. However the method is missing in version 5. How the database schema can be validated in Hibernate 5? 回答1: The functionality was extracted and is accessible through interface SchemaValidator. 来源: https://stackoverflow.com/questions/42013850/validate-database-schema-in-hibernate-5

peewee - change schema dynamically

半世苍凉 提交于 2021-01-29 11:14:13
问题 I have the same question/problem than this post -> peewee - modify db model meta (e.g. schema) dynamically . I want to change the schema field in my Meta class dynamically. This is my code: class GPSPosition(Model): def __init__(self, esquema, vehiculo, fechaFrom): self.esquema = esquema + '_org' self.vehiculo = vehiculo self.fechaFrom = fechaFrom orgid = BigIntegerField() id = BigIntegerField() vehicleid = BigIntegerField() driverid = BigIntegerField() originaldriverid = BigIntegerField(null

MongoError: Document failed validation - How to insert both float and int into the same field - which is marked as double?

寵の児 提交于 2021-01-28 14:45:44
问题 I'm having problems with inserting into mongoDB because good objects don't pass the mongoDB validator . To make it worse, the error is a generic: Document failed validation which in a big multi-nested object can make things confusing regarding where exactly this validation fails. myValidatorIs = { validator: { $jsonSchema : { bsonType: "object" , required: [ "price" ] , properties: { price: { bsonType: "double" // price needs to be a double, tried with decimal also. , description: "must be a

MongoError: Document failed validation - How to insert both float and int into the same field - which is marked as double?

江枫思渺然 提交于 2021-01-28 14:45:33
问题 I'm having problems with inserting into mongoDB because good objects don't pass the mongoDB validator . To make it worse, the error is a generic: Document failed validation which in a big multi-nested object can make things confusing regarding where exactly this validation fails. myValidatorIs = { validator: { $jsonSchema : { bsonType: "object" , required: [ "price" ] , properties: { price: { bsonType: "double" // price needs to be a double, tried with decimal also. , description: "must be a

Generate database schema diagram for Databricks

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-28 11:11:09
问题 I'm creating a Databricks application and the database schema is getting to be non-trivial. Is there a way I can generate a schema diagram for a Databricks database (something similar to the schema diagrams that can be generated from mysql)? 回答1: There are 2 variants possible: using Spark SQL with show databases , show tables in <database> , describe table ... using spark.catalog.listDatabases , spark.catalog.listTables , spark.catagog.listColumns . 2nd variant isn't very performant when you