Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Clubphp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Clubphp
Commits
280686c4
Commit
280686c4
authored
May 17, 2026
by
Mahmoud Aglan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixerd shit
parent
9eb7700d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
35 deletions
+31
-35
Phase_66_009_add_activated_by_payment_id_columns.php
...ions/Phase_66_009_add_activated_by_payment_id_columns.php
+31
-35
No files found.
database/migrations/Phase_66_009_add_activated_by_payment_id_columns.php
View file @
280686c4
<?php
<?php
declare
(
strict_types
=
1
);
declare
(
strict_types
=
1
);
return
[
return
function
(
\App\Core\Database
$db
)
{
'up'
=>
"
$tables
=
[
ALTER TABLE `members`
'members'
=>
[
ADD COLUMN `activated_by_payment_id` BIGINT UNSIGNED NULL AFTER `membership_number`,
[
'activated_by_payment_id'
,
'BIGINT UNSIGNED NULL'
,
'membership_number'
],
ADD COLUMN `activated_at` DATETIME NULL AFTER `activated_by_payment_id`;
[
'activated_at'
,
'DATETIME NULL'
,
'activated_by_payment_id'
],
],
'spouses'
=>
[
[
'activated_by_payment_id'
,
'BIGINT UNSIGNED NULL'
,
'status'
],
[
'fee_receipt_number'
,
'VARCHAR(50) NULL'
,
'activated_by_payment_id'
],
],
'children'
=>
[
[
'activated_by_payment_id'
,
'BIGINT UNSIGNED NULL'
,
'status'
],
[
'fee_receipt_number'
,
'VARCHAR(50) NULL'
,
'activated_by_payment_id'
],
],
'temporary_members'
=>
[
[
'activated_by_payment_id'
,
'BIGINT UNSIGNED NULL'
,
'status'
],
[
'fee_receipt_number'
,
'VARCHAR(50) NULL'
,
'activated_by_payment_id'
],
],
];
ALTER TABLE `spouses`
foreach
(
$tables
as
$table
=>
$columns
)
{
ADD COLUMN `activated_by_payment_id` BIGINT UNSIGNED NULL AFTER `status`,
foreach
(
$columns
as
[
$col
,
$type
,
$after
])
{
ADD COLUMN `fee_receipt_number` VARCHAR(50) NULL AFTER `activated_by_payment_id`;
$exists
=
$db
->
selectOne
(
"SELECT 1 FROM information_schema.columns WHERE table_schema = DATABASE() AND table_name = ? AND column_name = ?"
,
ALTER TABLE `children`
[
$table
,
$col
]
ADD COLUMN `activated_by_payment_id` BIGINT UNSIGNED NULL AFTER `status`,
);
ADD COLUMN `fee_receipt_number` VARCHAR(50) NULL AFTER `activated_by_payment_id`;
if
(
!
$exists
)
{
$db
->
raw
(
"ALTER TABLE `
{
$table
}
` ADD COLUMN `
{
$col
}
`
{
$type
}
AFTER `
{
$after
}
`"
);
ALTER TABLE `temporary_members`
}
ADD COLUMN `activated_by_payment_id` BIGINT UNSIGNED NULL AFTER `status`,
}
ADD COLUMN `fee_receipt_number` VARCHAR(50) NULL AFTER `activated_by_payment_id`
}
"
,
};
'down'
=>
"
ALTER TABLE `members`
DROP COLUMN `activated_by_payment_id`,
DROP COLUMN `activated_at`;
ALTER TABLE `spouses`
DROP COLUMN `activated_by_payment_id`,
DROP COLUMN `fee_receipt_number`;
ALTER TABLE `children`
DROP COLUMN `activated_by_payment_id`,
DROP COLUMN `fee_receipt_number`;
ALTER TABLE `temporary_members`
DROP COLUMN `activated_by_payment_id`,
DROP COLUMN `fee_receipt_number`
"
,
];
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment