Column Constraints
references
schema.create( "users", function( table ) {
table.unsignedInteger( "country_id" ).references( "id" ).onTable( "countries" );
} );CREATE TABLE `users` (
`country_id` INTEGER UNSIGNED NOT NULL,
CONSTRAINT `fk_users_country_id` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON UPDATE NO ACTION ON DELETE NO ACTION
)onTable
onUpdate
onDelete
Was this helpful?