focused_morning
DTDrizzle Team
•Created by focused_morning on 12/20/2023 in #help
Push without truncating
Is it possible to tell drizzle-kit not to truncate? Im in a situation that shouldn't truncate and it wants to.
2 replies
DTDrizzle Team
•Created by focused_morning on 11/8/2023 in #help
Why truncate??
Updating some schemas. All 48 records in the item table have cmsSlug and cmsId. All 48 records have a 36 character cmsId.
So my question is, why are the only options to truncate or cancel?
Output:
Warning Found data-loss statements:
· You're about to set not-null constraint to cmsSlug column without default, which contains 48 items
· You're about to change cmsId column type from varchar(191) to varchar(36) with 48 items
· You're about to set not-null constraint to cmsId column without default, which contains 48 items
1 replies
DTDrizzle Team
•Created by focused_morning on 10/31/2023 in #help
How do I write a trigger??
Not sure how this might happen, but If I needed to write a trigger how would I do this in Drizzle?
4 replies
DTDrizzle Team
•Created by focused_morning on 10/31/2023 in #help
How can I accomplish this in a schema?
I'm trying to make it so only one record with this itemId can have the status "ACTIVE" at a time. Something like this:
ALTER TABLE ItemMintPermission
ADD COLUMN ActiveItemID AS (CASE WHEN status='ACTIVE' THEN itemId ELSE NULL END) VIRTUAL;
ALTER TABLE ItemMintPermission
ADD UNIQUE INDEX idx_unique_active_item(ActiveItemID);
10 replies
DTDrizzle Team
•Created by focused_morning on 9/19/2023 in #help
How can I use a schema to generate something like this:
We have a 1 to many relationship between items and tokens, but an item can only have one minted token, example below:
CREATE TABLE Token (
id INT PRIMARY KEY AUTO_INCREMENT,
itemId INT,
status ENUM('Minted', 'Redeemed'),
uniqueMinted AS (CASE WHEN status = 'Minted' THEN itemId END),
UNIQUE(itemId, uniqueMinted)
);
Im not sure how to handle the uniqueMinted column
1 replies
DTDrizzle Team
•Created by focused_morning on 8/29/2023 in #help
Help, issue that will drop our user table
We generated and pushed our schemas to a dev branch in planetscale, and then deployed that branch no issue. One of the schemas was the User schema. We added two schemas to our db and pushed to dev again, no changes were made to the User schema, yet pushing to the dev db wants to truncate our user table because of the createdAt and updatedAt columns. What is happening and what should we do?
Schema
2 replies
DTDrizzle Team
•Created by focused_morning on 8/23/2023 in #help
Invalid default value for 'updatedAt'
Running into this issue, oddly enough this once worked and now breaks.
33 replies
DTDrizzle Team
•Created by focused_morning on 8/15/2023 in #help
whats the difference.
Whats the difference of using references like this:
and like this:
7 replies
DTDrizzle Team
•Created by focused_morning on 8/15/2023 in #help
onDelete cascade, Error: VT10001: foreign key constraints are not allowed
Trying to add onDelete cascade and db push produces this error:
foreign key constraints are not allowed
10 replies
DTDrizzle Team
•Created by focused_morning on 8/15/2023 in #help
migration/meta/0000_snapshot.json data is malformed
Running generate I see this in the console.
9 replies
DTDrizzle Team
•Created by focused_morning on 8/9/2023 in #help
Top Level await issue with latest [email protected], mysql2, planetscale
We are getting this error when following the release notes recommended setup for pscale/mysql:
8 replies
DTDrizzle Team
•Created by focused_morning on 8/1/2023 in #help
Does changing the name of a relationship have any consequence aside from having to fix any queries?
We want to change the name of a relationship and I was curious if this would cause any issues?
Let’s say person had a cat relationship and I wanted to name it cats, would this be okay?
4 replies
DTDrizzle Team
•Created by focused_morning on 7/25/2023 in #help
introspect failing with pscale db
Getting a strange error when running the introspect command. I'm using a connectionString from pscale.
drizzle.config:
- I've included ?ssl={"rejectUnauthorized":true}
script:
"introspect": "drizzle-kit introspect:mysql",
Error:
5 replies