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/developers/addons.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -227,17 +227,6 @@ The right relationships make life easier. See the Laravel documentation on relat
227
227
228
228
Laravel includes a way to create and update tables, called [migrations](https://laravel.com/docs/5.5/migrations). Migrations are ways to programmatically define your tables, and let the framework worry about the exact syntax to use. The advantage to this abstraction is being.
229
229
230
-
:::warning
231
-
232
-
When naming your tables, a standard convention that is wise to follow is to prefix your addon's tables with a short indentifier that is unqiue to your addon or group of addons (e.g. `disposable_`, `ch_`, `sp_`, etc.). For example, instead of naming a table `tours`, name it `ch_tours`. This includes pivot tables. See Laravel documentation on how to override the default conventions for table names, foreign relationships, etc. where required.
233
-
234
-
Not prefixing your tables could lead to unintended consequences, including but not limited to:
235
-
236
-
* Conflicting with future phpVMS core features that would use the same table name, thereby making it more difficult to update phpVMS at a later date.
237
-
* Conflicting with other addons by other 3rd party modules that don't head this warning.
238
-
239
-
:::
240
-
241
230
! You should *not* be using raw SQL
242
231
243
232
There is an `artisan` helper to generate migrations:
@@ -254,6 +243,17 @@ The `app/Database/migrations` directory has the core migrations and is a good re
254
243
255
244
!!!! Add new migration files when you have to modify a table, etc, after you've released it into the wild. The migrations that are run are kept track of, so if it's seen that it's already run the file, it won't run it again.
256
245
246
+
:::warning
247
+
248
+
When naming your tables, a standard convention that is wise to follow is to prefix your addon's tables with a short indentifier that is unqiue to your addon or group of addons (e.g. `disposable_`, `ch_`, `sp_`, etc.). For example, instead of naming a table `tours`, name it `ch_tours`. This includes pivot tables. See Laravel documentation on how to override the default conventions for table names, foreign relationships, etc. where required.
249
+
250
+
Not prefixing your tables could lead to unintended consequences, including but not limited to:
251
+
252
+
* Conflicting with future phpVMS core features that would use the same table name, thereby making it more difficult to update phpVMS at a later date.
253
+
* Conflicting with other addons by other 3rd party modules that don't head this warning.
254
+
255
+
:::
256
+
257
257
### Seeding Data
258
258
259
259
I've added a few extra features, including adding seed data, including adding seeder data. For example, the `Settings` table:
0 commit comments