mrnicericee
mrnicericee
Explore posts from servers
DTDrizzle Team
Created by mrnicericee on 9/18/2023 in #help
Dropping mysql unique errors
Hello! I saw there were already an issue created for it https://github.com/drizzle-team/drizzle-orm/issues/998 database: mysql package: drizzle-kit my own error message
errno: 3821,
sql: 'ALTER TABLE `cerberus_auth_user` DROP CONSTRAINT `cerberus_auth_user_username_unique`;',
sqlState: 'HY000',
sqlMessage: `target: personal.-.primary: vttablet: rpc error: code = Unknown desc = Check constraint 'cerberus_auth_user_username_unique' is not found in the table. (errno 3821) (sqlstate HY000) (CallerID: 1t4od6gbcxmj1mldqj6f): Sql: "alter table cerberus_auth_user drop check cerberus_auth_user_username_unique", BindVars: {REDACTED}`
errno: 3821,
sql: 'ALTER TABLE `cerberus_auth_user` DROP CONSTRAINT `cerberus_auth_user_username_unique`;',
sqlState: 'HY000',
sqlMessage: `target: personal.-.primary: vttablet: rpc error: code = Unknown desc = Check constraint 'cerberus_auth_user_username_unique' is not found in the table. (errno 3821) (sqlstate HY000) (CallerID: 1t4od6gbcxmj1mldqj6f): Sql: "alter table cerberus_auth_user drop check cerberus_auth_user_username_unique", BindVars: {REDACTED}`
I realized that the SQL query for dropping a UNIQUE the CONSTRAINT should be changed to INDEX
ALTER TABLE `[table here]` DROP INDEX `[constraint name]`
ALTER TABLE `[table here]` DROP INDEX `[constraint name]`
I ran the the above query in planetscale's console, and it successfully dropped the UNIQUE CONSTRAINT and then ran db:push and it successfully made the changes 🙂 I tried looking (but i am dumb) to see where the query for the drizzle-kit DROP statement would be built but I could not find anything 😦 would love to make a PR on this if possible 🙂
2 replies
TTCTheo's Typesafe Cult
Created by mrnicericee on 2/3/2023 in #questions
Import order
is there a vscode extension or prettier/eslint setting to do this?
// packages first
import a from 'a'
import c from 'c'
import b from 'b' // should error

// packages types
import type { a } from 'a'
import type { d } from 'd'
import type { c } from 'c' // should error

// local files
import { localFile } from '../thing';

// local file types
import { LocalFileSchema } from '../thing';
// packages first
import a from 'a'
import c from 'c'
import b from 'b' // should error

// packages types
import type { a } from 'a'
import type { d } from 'd'
import type { c } from 'c' // should error

// local files
import { localFile } from '../thing';

// local file types
import { LocalFileSchema } from '../thing';
and whenever you do a document format it'll order things
20 replies
TTCTheo's Typesafe Cult
Created by mrnicericee on 9/17/2022 in #questions
mega thread for theo's graphs?
looked through twitter w/ media query, but no graphs 😦
3 replies