question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error using totvs database: `Couldn\'t parse default value`

See original GitHub issue

Hi Prisma Team! Prisma Migrate just crashed.

Versions

Name Version
Platform debian-openssl-1.1.x
Node v14.15.4
Prisma CLI 2.15.0
Binary e51dc3b5a9ee790a07104bec1c9477d51740fe54

Error

Error: [libs/sql-schema-describer/src/mssql.rs:264:30] called `Result::unwrap()` on an `Err` value: "Couldn\'t parse default value: `CREATE DEFAULT DEF_DLOGICONULL AS 0\r\n`"

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pimeyscommented, Feb 19, 2021

I can replicate the bug. There seems to be another way of setting default values in SQL Server. Typically, we create defaults like this:

CREATE TABLE cats (
    id INT IDENTITY PRIMARY KEY,
    name NVARCHAR(255) CONSTRAINT DF_cat_name DEFAULT 'musti'
);

There is another way of creating default values too in SQL Server, you can define them beforehand, and use a stored procedure to set them to a column:

CREATE DEFAULT catcat AS 'musti';

CREATE TABLE cats (
    id INT IDENTITY PRIMARY KEY,
    name NVARCHAR(255)
);

sp_bindefault 'catcat', 'dbo.cats.name';

So, this kind of makes our migrations a bit problematic. We’d like to have the default values in the data model, and then point to them from the column declaration to get the correct result. I need to discuss this a bit with the team, if we could find a nice and easy solution, or will this stretch to a complete new feature.

0reactions
pimeyscommented, Feb 24, 2021

Documentation change for this: https://github.com/prisma/docs/pull/1348

Read more comments on GitHub >

github_iconTop Results From Across the Web

Consultor Eletrônico - totvs
10180 - Error reading Fathom defaults file: "<message for failure>" (10180), Progress, Progress Software Corporation. 10181 - Error parsing Fathom defaults ...
Read more >
Error in MySQL when setting default value for DATE or ...
I got into a situation where the data was mixed between NULL and 0000-00-00 for a date field ...
Read more >
Prisma 2.18.0 Release - GitClear
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, ... Error using totvs database: Couldn\'t parse default value ......
Read more >
Linha Datasul - tdn totvs
1013 The configuration registry key could not be written. 1014 One of the files in the Registry database had to be recovered by...
Read more >
couchbase/discuss - Gitter
Hey all - looking for some help trying to get data out of couchbase in a very ... -prototype.default.svc:<0.331.0>:menelaus_web:loop:143]Server error during ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found