|
|
@@ -54,6 +54,23 @@ class Database: |
|
|
|
CHILD_TABLE_COLUMNS = ("parent", "parenttype", "parentfield") |
|
|
|
MAX_WRITES_PER_TRANSACTION = 200_000 |
|
|
|
|
|
|
|
# NOTE: |
|
|
|
# FOR MARIADB - using no cache - as during backup, if the sequence was used in anyform, |
|
|
|
# it drops the cache and uses the next non cached value in setval query and |
|
|
|
# puts that in the backup file, which will start the counter |
|
|
|
# from that value when inserting any new record in the doctype. |
|
|
|
# By default the cache is 1000 which will mess up the sequence when |
|
|
|
# using the system after a restore. |
|
|
|
# |
|
|
|
# Another case could be if the cached values expire then also there is a chance of |
|
|
|
# the cache being skipped. |
|
|
|
# |
|
|
|
# FOR POSTGRES - The sequence cache for postgres is per connection. |
|
|
|
# Since we're opening and closing connections for every request this results in skipping the cache |
|
|
|
# to the next non-cached value hence not using cache in postgres. |
|
|
|
# ref: https://stackoverflow.com/questions/21356375/postgres-9-0-4-sequence-skipping-numbers |
|
|
|
SEQUENCE_CACHE = 0 |
|
|
|
|
|
|
|
class InvalidColumnName(frappe.ValidationError): |
|
|
|
pass |
|
|
|
|
|
|
|