feat: require hospital code and add company APIs
This commit is contained in:
@@ -7,7 +7,6 @@ CREATE TABLE IF NOT EXISTS hospitals (
|
||||
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
code VARCHAR(50) NOT NULL,
|
||||
name VARCHAR(150) NOT NULL,
|
||||
is_default TINYINT(1) NOT NULL DEFAULT 0,
|
||||
active TINYINT(1) NOT NULL DEFAULT 1,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
|
||||
17
database/migrations/002_remove_default_hospital.sql
Normal file
17
database/migrations/002_remove_default_hospital.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
USE `cpone_middleware`;
|
||||
|
||||
SET @drop_default_column = IF(
|
||||
EXISTS(
|
||||
SELECT 1
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = DATABASE()
|
||||
AND table_name = 'hospitals'
|
||||
AND column_name = 'is_default'
|
||||
),
|
||||
'ALTER TABLE hospitals DROP COLUMN is_default',
|
||||
'SELECT 1'
|
||||
);
|
||||
|
||||
PREPARE drop_default_statement FROM @drop_default_column;
|
||||
EXECUTE drop_default_statement;
|
||||
DEALLOCATE PREPARE drop_default_statement;
|
||||
Reference in New Issue
Block a user