Skip to content

Commit 4c4bac5

Browse files
committed
move to local variable
1 parent 717d4b5 commit 4c4bac5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

datajoint/declare.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
"NULL",
1818
} # SQL literals to be used without quotes (case insensitive)
1919
EXTERNAL_TABLE_ROOT = "~external"
20-
METADATA_ATTRIBUTES_SQL = [
21-
"`_{full_table_name}_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP"
22-
]
2320

2421
TYPE_PATTERN = {
2522
k: re.compile(v, re.I)
@@ -312,14 +309,18 @@ def declare(full_table_name, definition, context):
312309
index_sql,
313310
external_stores,
314311
) = prepare_declare(definition, context)
312+
313+
metadata_attr_sql = [
314+
"`_{full_table_name}_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP"
315+
]
315316
attribute_sql.extend(
316317
[
317318
attr.format(
318319
full_table_name=sha1(
319320
full_table_name.replace("`", "").encode("utf-8")
320321
).hexdigest()
321322
)
322-
for attr in METADATA_ATTRIBUTES_SQL
323+
for attr in metadata_attr_sql
323324
]
324325
)
325326

0 commit comments

Comments
 (0)