Comments (3)
Thanks @hafezdivandari. I'll give that a go when I'm back at my desk.
from framework.
Hey @hafezdivandari - that seems to fix my issue. Thank you for your helpful response. 👍🏻
from framework.
@midnite81 on MySQL you can't drop the key if the column is auto incremental, so you should first drop the auto increment then drop its primary (just switch those 2 commands):
Schema::table('ticket_users', function (Blueprint $table) {
$table->bigInteger('id')->change(); // drop auto increment first
$table->dropPrimary(); // then drop primary
$table->dropColumn('id');
$table->primary(['ticket_id', 'user_id']);
});
Before 11.15, the change commands would always run at first, that's why you were not getting any error, but after 11.15, the commands compile in the real order.
However, dropping auto increment and primary seems redundant in your case, as you are eventually dropping the whole column, you may want to simplify this to:
Schema::table('ticket_users', function (Blueprint $table) {
// $table->bigInteger('id')->change(); // no need for this
// $table->dropPrimary(); // no need for this either
$table->dropColumn('id');
$table->primary(['ticket_id', 'user_id']);
});
from framework.
Related Issues (20)
- Migration is not working as expected (as written in docs) HOT 5
- Potential infinite recursion when executing `schema:dump` HOT 2
- Potential infinite recursion when executing `schema:dump` HOT 10
- Custom validation rules break generated error MessageBag when custom messages are defined HOT 2
- limit() in relationship load extremely slow in Laravel 11 HOT 2
- Listeners are handled within transactions despite the ShouldHandleEventsAfterCommit interface
- Laravel 11 auto session=database throws intermittent SQLSTATE[08004] [1040] Too many connections error HOT 5
- DatabaseRule "unique" fails quietly when given an incorrect column HOT 2
- Where Query with Arrays for JSON Columns HOT 1
- Adding a batch to a chain through prependToChain/appendToChain results in serialization errors HOT 1
- Cannot override default error page with Laravel 11 Bootstrap Exception Handling HOT 2
- firstOrNew on belongsToMany doesn't work as expected HOT 3
- Accessor date casting formatting as UTC when being serialized to JSON. HOT 1
- Contextual binding resolved when it shouldn't be for LogManager HOT 1
- Using Emergency logging channel throw an exception HOT 2
- Sqlite column processing crashes when column has a "/" in its name
- Database migrations in pretend mode doesn't display insert statements to migrations table
- Job runs longer than "retry_after" will re-run immediately once the "retry after" seconds passed. HOT 1
- Unexpected behaviour when chunking a query HOT 3
- Artisan db:show and db:table fails when database has tables in multiple schemas HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from framework.