You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/2-naming-conventions/naming-conventions.md
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,15 @@ Singular name of what is stored in the column (unless the column data type is a
60
60
61
61
Add a comment to the database dictionary for every column.
62
62
63
+
### Check Constraint
64
+
65
+
Table name or table abbreviation followed by the column and/or role of the check constraint, a `_ck` and an optional number suffix.
66
+
67
+
Examples:
68
+
69
+
*`employees_salary_min_ck`
70
+
*`orders_mode_ck`
71
+
63
72
### DML / Instead of Trigger
64
73
65
74
Choose a naming convention that includes:
@@ -182,7 +191,9 @@ Examples:
182
191
183
192
### Table
184
193
185
-
Plural[^1] name of what is contained in the table (unless the table is designed to always hold one row only – then you should use a singular name)
194
+
Plural[^1] name of what is contained in the table (unless the table is designed to always hold one row only – then you should use a singular name).
195
+
196
+
Suffixed by `_eb` when protected by an editioning view.
186
197
187
198
Add a comment to the database dictionary for every table and every column in the table.
188
199
@@ -192,6 +203,7 @@ Examples:
192
203
193
204
*`employees`
194
205
*`departments`
206
+
*`countries_eb` - table interfaced by an editioning view named `countries`
195
207
*`sct_contracts`
196
208
*`sct_contract_lines`
197
209
*`sct_incentive_modules`
@@ -226,6 +238,8 @@ Examples:
226
238
Plural[^1] name of what is contained in the view.
227
239
Optionally suffixed by an indicator identifying the object as a view (mostly used, when a 1:1 view layer lies above the table layer)
228
240
241
+
Editioning views are named like the original underlying table to avoid changing the existing application code when introducing edition based redefinition (EBR).
242
+
229
243
Add a comment to the database dictionary for every view and every column.
230
244
231
245
Optionally prefixed by a project abbreviation.
@@ -234,6 +248,7 @@ Examples:
234
248
235
249
*`active_orders`
236
250
*`orders_v` - a view to the orders table
251
+
*`countries` - an editioning view for table `countries_eb`
237
252
238
253
[^1]:
239
254
We see a table and a view as a collection. A jar containing beans is labeled "beans".
`GENERATED ALWAYS AS IDENTITY` ensures that the `location_id` is populated by a sequence. It is not possible to override the behavior in the application.
49
+
50
+
However, if you use a framework that produces an `INSERT` statement including the surrogate key column, and you cannot change this behavior, then you have to use the `GENERATED BY DEFAULT ON NULL AS IDENTITY` option. This has the downside that the application may pass a value, which might lead to an immediate or delayed `ORA-00001: unique constraint violated` error.
0 commit comments