Yaakov
10/13/2021, 10:43 PMid
field being an integer.
I get the following error: PrismaClientValidationError: Argument id: Got invalid value '1' on prisma.updateOnePost. Provided String, expected Int.
app.put('/publish/:id', async (req, res) => {
const { id } = req.params
const post = await prisma.post.update({
where: { id },
data: { published: true },
})
res.json(post)
})
Is there anyway to run this without calling parseInt(id)
?YeonHoPark
10/14/2021, 2:04 AMuser
10/14/2021, 6:45 AMGarrick Chippendale
10/14/2021, 8:25 AMError: db error: ERROR: syntax error at or near ","
0: sql_migration_connector::sql_database_step_applier::apply_migration
at migration-engine\connectors\sql-migration-connector\src\<http://sql_database_step_applier.rs:11|sql_database_step_applier.rs:11>
1: migration_core::api::SchemaPush
at migration-engine\core\src\<http://api.rs:184|api.rs:184>
i keep getting this error from npx prisma db push
, and i really cant fix it or figure out whats wrong. it started happening when prisma was telling me It will have to drop my data to push my db, because I changed my enum (but the enum is identical to whats in the database except with a different name), so I simply went into the database and manually renamed the enum to match what it is in my prisma schema, so that prisma wouldnt have to drop my data. the only 2 outcomes i can get are prisma saying it has to drop my data, or the above error. anything i should try/do?Halvor
10/14/2021, 8:37 AMJemin Kothari
10/14/2021, 8:50 AMenum Test {
Open
Converted
Junk
}
Codker
10/14/2021, 10:30 AMCodker
10/14/2021, 10:30 AMDev__
10/14/2021, 12:21 PMjcardona
10/14/2021, 3:15 PMjcardona
10/14/2021, 3:15 PMAlex Vilchis
10/14/2021, 6:02 PMnode_modules
directory, instead of using the root package node_modules
(where nexus-plugin-prisma looks for them) 🤔Augustus Chang
10/14/2021, 8:20 PMSwapnil Tandel
10/14/2021, 8:32 PMIbad Shaikh
10/15/2021, 6:03 AMChris Tsongas
10/15/2021, 6:17 AMheroku run npx prisma migrate deploy
however when I try to seed the database using heroku run npx prisma db seed
it borks with the following error:
Running seed command `ts-node prisma/seed/index.ts` ...
An error occured while running the seed command:
Error: Command failed with ENOENT: ts-node prisma/seed/index.ts
spawn ts-node ENOENT
Mykyta Machekhin
10/15/2021, 9:14 AMMatt Lawson
10/15/2021, 9:21 AMMischa
10/15/2021, 11:41 AMNathaniel Babalola
10/15/2021, 1:23 PMnpx prisma migrate dev
, any reason why Prisma is converting table.column_unique
to table.column_key
?Mykyta Machekhin
10/15/2021, 4:00 PMWilliam Chantry
10/15/2021, 4:06 PMDanny
10/15/2021, 6:30 PMprisma db push
to "push" the changes to the database without actually creating a new migration, but if I run prisma db seed
, it doesn't reset the database in the same way that prisma migrate reset
would do - it would just run the seed scripts twice, potentially duplicating data, etc. Is there a suggested workflow for prototyping seed changes without needing to either (a) prisma migrate reset
or (b) drop all the records across all tables in the seed script?Pierre Ortega
10/15/2021, 8:33 PMYour raw query had an incorrect number of parameters. Expected: `0`, actual: `2`
But my query does not use any parameters, I think.
const history = await db.$queryRaw<HistoryData>`
SELECT
a.day,
s."value" as slp,
s."value" - lag(s."value" ) over (order by a.day) as increase
FROM (
SELECT
DISTINCT d.day,
max(s. "date") OVER (ORDER BY d.day) AS effective_date
FROM (SELECT generate_series('2021-10-01'::date, now()::date, '1d')::date) d (day)
LEFT JOIN "WalletsHistory" s ON DATE(s.date) = d.day AND s.wallet_id = '${wallet.id}'
) a
INNER JOIN "WalletsHistory" s ON s.date = a.effective_date
AND s.wallet_id = '${wallet.id}'
ORDER BY
a.day;
`;
Garrick Chippendale
10/15/2021, 11:35 PMuser
model which has wallet_balance(int)
and `bank_balance(int)`and I want to have a generated column saying total_balance = wallet_balance + bank_balance
?Thanh-Long PHAM
10/15/2021, 11:52 PMuser
10/16/2021, 9:14 AMSubho
10/16/2021, 12:55 PMProperty 'createMany' does not exist on type 'SampleEntityDelegate<RejectOnNotFound | RejectPerOperation>
From package.json:
"prisma": "^3.2.1",
"@prisma/client": "^3.2.1",
Logan
10/16/2021, 3:15 PM[
'guildID1': {
messageTotal: 1,
inviteTotal: 1,
memberTotal: 1,
joinTotal: 1,
leaveTotal: 1
},
'guildID2': {
messageTotal: 1,
inviteTotal: 2,
memberTotal: 3,
joinTotal: 4,
leaveTotal: 5
}
]
Hey, just wondering how I can use createMany
method to insert the data above? the table looks like:Logan
10/16/2021, 3:16 PMguildids
it should be a new row.