AH
Есть база на мускуле со структурой:
CREATE TABLE `booking_service` (
`id` bigint unsigned NOT NULL,
`booking_id` bigint unsigned NOT NULL,
`service_id` bigint unsigned NOT NULL,
`window_id` bigint unsigned NOT NULL,
`employer_id` bigint unsigned DEFAULT NULL,
`price` decimal(10,2) NOT NULL,
`begin_at` timestamp NULL DEFAULT NULL,
`end_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `booking_service_booking_id_index` (`booking_id`),
KEY `booking_service_service_id_index` (`service_id`),
KEY `booking_service_employer_id_index` (`employer_id`),
CONSTRAINT `booking_service_booking_id_foreign` FOREIGN KEY (`booking_id`) REFERENCES `bookings` (`id`) ON DELETE CASCADE,
CONSTRAINT `booking_service_employer_id_foreign` FOREIGN KEY (`employer_id`) REFERENCES `employers` (`id`) ON UPDATE SET NULL,
CONSTRAINT `booking_service_service_id_foreign` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
Накатываю на неё миграцию:
Schema::table('booking_service', function (Blueprint $table) {
$table->bigIncrements('id')->change();
});
В мускуле проблем нет, всё работает.
Сейчас перевожу проект на postgres и получаю ошибку:
SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation "booking_service_id_seq" already exists (SQL: CREATE SEQUENCE booking_service_id_seq)
Schema::disableForeignKeyConstraints();
не срабатывает.Куда копать?