Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts target 设置为 es2022 后,会丢失 default value #429

Open
fengmk2 opened this issue Nov 30, 2024 · 0 comments
Open

ts target 设置为 es2022 后,会丢失 default value #429

fengmk2 opened this issue Nov 30, 2024 · 0 comments

Comments

@fengmk2
Copy link
Contributor

fengmk2 commented Nov 30, 2024

通过 cnpmcore https://github.com/cnpm/cnpmcore/blob/master/tsconfig.json#L5 可以验证。

改成 es2022 后 insert sql 会少了 gmt_create

sqlMessage: "Field 'gmt_create' doesn't have a default value"
sql: "INSERT INTO `users` (`user_id`, `name`, `email`, `password_salt`, `password_integrity`, `ip`, `is_private`) VALUES ('674ac11c3116ab0768e8c4a1', 'testuser', '[email protected]', 'a51413f259f4cc245c6f0aa97614a5ae8d2312f79fa5bf9272e0e83d3796', 'sha512-hw8oPVmmCUkHkmwTSBLHAy7VEKzZ73VLoAffCSIHQVV0Vo+Wd6v3vaK+KS4jYxezsX29fVKqgsMYb2yXhuquuw==', '127.0.0.1', true)"

正确的 sql 应该是

INSERT INTO `users` (`gmt_create`, `gmt_modified`, `user_id`, `name`, `email`, `password_salt`, `password_integrity`, `ip`, `is_private`) VALUES ('2024-11-30 15:43:49.247', '2024-11-30 15:43:49.247', '674ac23512a145130b1a680a', 'testuser', '[email protected]', 'ec11980c723a3e6073273d4e5cb7c98977d18a3e5bb9f7de53b2a84c5b77', 'sha512-ZZSpn073K/JN1AWwGAPUYgz1lqJU1FdlQy6bCLtbvroiFSMsJ7XeUspzlhUB6aneb6m3trx9yakPeMRyLO8LDg==', '127.0.0.1', true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant