sqlboiler/templates
Aaron L a5cb765403 Ensure created_at isn't updated when unnecessary
- When we build the update whitelist (when the user doesn't provide one)
  we simply say that the whitelist is all columns except pkeys. The
  reason we do this is because sqlboiler doesn't support dirty tracking
  and if you want to update just a few fields, it's easier to just
  explicitly pass a whitelist when you update. However, in the case of
  created_at - it's a field that's usually managed by us and so we
  should not be updating it unless a user explicitly requests it via the
  whitelist. So if the whitelist is empty we prune that column now if it
  exists from the auto-created whitelist.
- The user also reported that upsert has the same fate, but the logic is
  somewhat different there. It expects that there's a value for
  created_at or it assumes that one needs to be created. There's no
  more magic we can do around this one unfortunately. Upsert is a
  mythical beast that doesn't play as nicely with our model, so users
  will just have to be more careful.
- Fix #106
2017-02-24 22:52:09 -08:00
..
singleton Add enum const generation 2016-11-11 01:06:30 -08:00
00_struct.tpl Make templates generate again 2016-09-18 16:02:08 -07:00
01_types.tpl Change 'if eq .NoHooks false' -> 'if not .NoHooks' 2016-09-20 21:08:19 -07:00
02_hooks.tpl Change 'if eq .NoHooks false' -> 'if not .NoHooks' 2016-09-20 21:08:19 -07:00
03_finishers.tpl Fix all references to moved elements. 2016-09-14 21:02:24 -07:00
04_relationship_to_one.tpl Fix combining relationship query mods 2016-11-15 21:57:21 -08:00
05_relationship_one_to_one.tpl Fix combining relationship query mods 2016-11-15 21:57:21 -08:00
06_relationship_to_many.tpl Fix combining relationship query mods 2016-11-15 21:57:21 -08:00
07_relationship_to_one_eager.tpl Attach all eagerly loaded models in to-one 2017-01-26 22:06:47 -08:00
08_relationship_one_to_one_eager.tpl Attach all eagerly loaded models in to-one 2017-01-26 22:06:47 -08:00
09_relationship_to_many_eager.tpl Ensure that relationship structs aren't clobbered 2016-11-08 18:25:15 -08:00
10_relationship_to_one_setops.tpl Add missing function variants for setops. 2017-01-09 21:06:47 -08:00
11_relationship_one_to_one_setops.tpl Add missing function variants for setops. 2017-01-09 21:06:47 -08:00
12_relationship_to_many_setops.tpl Fix null dereference 2017-01-24 23:04:59 -08:00
13_all.tpl Fix template spacing with new output 2016-09-24 00:52:18 -07:00
14_find.tpl Use _ to avoid reserved words in func args 2017-02-24 22:27:05 -08:00
15_insert.tpl Fix mysql LastInsertId() 2016-09-24 16:10:26 -07:00
16_update.tpl Ensure created_at isn't updated when unnecessary 2017-02-24 22:52:09 -08:00
17_upsert.tpl Ignore empty errors on postgres upsert fail 2017-01-05 21:31:43 -08:00
18_delete.tpl Fix template spacing with new output 2016-09-24 00:52:18 -07:00
19_reload.tpl Fix template spacing with new output 2016-09-24 00:52:18 -07:00
20_exists.tpl Use _ to avoid reserved words in func args 2017-02-24 22:27:05 -08:00
21_auto_timestamps.tpl File shuffle 2016-09-18 16:41:04 -07:00