Compare commits

5 Commits

Author SHA1 Message Date
王冠智 14689f0dc5 Merge d218fcf074 into 2aee46f169 2024-05-23 02:37:55 -03:00
Julien Le Coupanec 2aee46f169 Merge pull request #381 from FabricioLopees/fix/java
Update readme: fix grammatical error in java.md
2024-04-15 10:53:51 +02:00
FabricioLopees 22977d5ca1 update readme: fix grammatical error in java.md 2024-04-13 13:05:38 -03:00
FabricioLopees a2c99c9674 update readme: fix grammatical error in java.md 2024-04-13 12:52:16 -03:00
王冠智 | Joe d218fcf074 Migration added foreignId method
Laravel 7.x added foreignId method
2022-03-22 14:55:34 +08:00
2 changed files with 5 additions and 3 deletions
+2
View File
@@ -419,6 +419,8 @@ $table->dropSpatialIndex('geo_location_spatialindex'); // Drop a spatial index f
// FOREIGN KEY CONSTRAINTS // FOREIGN KEY CONSTRAINTS
$table->foreign('user_id')->references('id')->on('users'); // Create foreign key constraints. $table->foreign('user_id')->references('id')->on('users'); // Create foreign key constraints.
$table->foreignId('user_id')->constrained('users'); // Create foreign key terser methods (7.x).
$table->foreignId('user_id')->constrained()->onUpdate('cascade')->onDelete('cascade'); // Specify the desired action for the "on delete" and "on update" properties of the constraint(7.x).
$table->dropForeign('posts_user_id_foreign'); // Drop foreign key (accepts an array of strings). $table->dropForeign('posts_user_id_foreign'); // Drop foreign key (accepts an array of strings).
Schema::enableForeignKeyConstraints(); // Enable foreign key constraints within your migrations. Schema::enableForeignKeyConstraints(); // Enable foreign key constraints within your migrations.
+1 -1
View File
@@ -286,7 +286,7 @@ for(dataType item : array) {
### ACCESS MODIFIERS ### ACCESS MODIFIERS
1. defualt(No keyword required) 1. default(No keyword required)
2. private 2. private
3. public 3. public
4. protected 4. protected