16 $dir = dirname( __DIR__, 1 ) .
'/sql';
17 $dbType = $updater->getDB()->getType();
19 if ( $dbType ===
'mysql' || $dbType ===
'sqlite' ) {
20 $updater->addExtensionTable(
22 "{$dir}/{$dbType}/translate_sections.sql"
24 $updater->addExtensionTable(
26 "{$dir}/{$dbType}/revtag.sql"
28 $updater->addExtensionTable(
29 'translate_groupstats',
30 "{$dir}/{$dbType}/translate_groupstats.sql"
32 $updater->addExtensionTable(
34 "{$dir}/{$dbType}/translate_reviews.sql"
36 $updater->addExtensionTable(
37 'translate_groupreviews',
38 "{$dir}/{$dbType}/translate_groupreviews.sql"
40 $updater->addExtensionTable(
42 "{$dir}/{$dbType}/translate_tm.sql"
44 $updater->addExtensionTable(
46 "{$dir}/{$dbType}/translate_metadata.sql"
48 $updater->addExtensionTable(
49 'translate_messageindex',
50 "{$dir}/{$dbType}/translate_messageindex.sql"
52 $updater->addExtensionTable(
54 "{$dir}/{$dbType}/translate_stash.sql"
56 $updater->addExtensionTable(
57 'translate_translatable_bundles',
58 "{$dir}/{$dbType}/translate_translatable_bundles.sql"
60 $updater->addExtensionUpdateOnVirtualDomain( [
63 'translate_message_group_subscriptions',
64 "{$dir}/{$dbType}/translate_message_group_subscriptions.sql",
67 $updater->addExtensionUpdateOnVirtualDomain( [
71 "{$dir}/{$dbType}/translate_cache.sql",
75 if ( $dbType ===
'mysql' ) {
77 $updater->addExtensionUpdateOnVirtualDomain( [
82 "{$dir}/{$dbType}/translate_cache-alter-varbinary.sql",
85 $updater->modifyExtensionField(
86 'translate_groupreviews',
88 "{$dir}/{$dbType}/translate_groupreviews-alter-varbinary.sql",
91 } elseif ( $dbType ===
'postgres' ) {
92 $updater->addExtensionTable(
94 "{$dir}/{$dbType}/tables-generated.sql"
96 $updater->addExtensionUpdateOnVirtualDomain( [
102 'th_timestamp::timestamp with time zone'
107 $updater->dropExtensionIndex(
108 'translate_messageindex',
110 "{$dir}/{$dbType}/patch-translate_messageindex-unique-to-pk.sql"
112 $updater->dropExtensionIndex(
115 "{$dir}/{$dbType}/patch-translate_tmt-unique-to-pk.sql"
117 $updater->dropExtensionIndex(
119 'rt_type_page_revision',
120 "{$dir}/{$dbType}/patch-revtag-unique-to-pk.sql"
124 $updater->modifyExtensionTable(
126 "{$dir}/{$dbType}/patch-revtag-int-to-bigint-unsigned.sql"
128 $updater->modifyExtensionTable(
130 "{$dir}/{$dbType}/patch-translate_reviews-unsigned.sql"
132 $updater->addExtensionUpdateOnVirtualDomain( [
135 'translate_message_group_subscriptions',
136 'tmgs_subscription_id',
137 "{$dir}/{$dbType}/patch-translate_message_group_subscriptions-composite-primary-key.sql",
141 $updater->addPostDatabaseUpdateMaintenance( SyncTranslatableBundleStatusMaintenanceScript::class );
142 $updater->addPostDatabaseUpdateMaintenance( RemoveRedundantMessageGroupMetadataMaintenanceScript::class );