Repository navigation
Commit f17b3bf
committed
Create ON UPDATE triggers for columns with generated defaults
A column with ON UPDATE CURRENT_TIMESTAMP and an expression default, such
as DEFAULT CURRENT_TIMESTAMP or DEFAULT (NOW()), has the EXTRA value
"DEFAULT_GENERATED on update CURRENT_TIMESTAMP". The trigger was created
only when EXTRA was exactly "on update CURRENT_TIMESTAMP", so these columns
never updated, and ALTER COLUMN ... SET DEFAULT (expr) removed a working
trigger from a column.
The trigger still updates unconditionally, as tracked in the issue below.
See #5541 parent 4bbad21 commit f17b3bf
2 files changed
Lines changed: 27 additions & 1 deletion
File tree
- packages/mysql-on-sqlite
- src/sqlite
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7227 | 7227 | | |
7228 | 7228 | | |
7229 | 7229 | | |
7230 | | - | |
| 7230 | + | |
7231 | 7231 | | |
7232 | 7232 | | |
7233 | 7233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2010 | 2010 | | |
2011 | 2011 | | |
2012 | 2012 | | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
2013 | 2034 | | |
2014 | 2035 | | |
2015 | 2036 | | |
| |||
2716 | 2737 | | |
2717 | 2738 | | |
2718 | 2739 | | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
2719 | 2745 | | |
2720 | 2746 | | |
2721 | 2747 | | |
| |||
0 commit comments