33namespace StellarWP \Schema ;
44
55use StellarWP \Schema \Config ;
6- use StellarWP \Schema \Fields ;
7- use StellarWP \Schema \Fields \Contracts \Schema_Interface as Field_Schema_Interface ;
86use StellarWP \Schema \Tables ;
9- use StellarWP \Schema \Tables \Contracts \Schema_Interface as Table_Schema_Interface ;
7+ use StellarWP \Schema \Tables \Contracts \Table_Interface as Table_Schema_Interface ;
108use StellarWP \Schema \Tables \Filters \Group_FilterIterator ;
119use WP_CLI ;
1210
@@ -37,7 +35,7 @@ public function __construct( $db = null, $container = null ) {
3735 }
3836
3937 /**
40- * Whether all the custom tables exist or not. Does not check custom fields.
38+ * Whether all the custom tables exist or not.
4139 *
4240 * Note: the method will return `false` if even one table is missing.
4341 *
@@ -47,7 +45,7 @@ public function __construct( $db = null, $container = null ) {
4745 *
4846 * @param string|null $group An optional group name to restrict the check to.
4947 *
50- * @return bool Whether all custom tables exist or not. Does not check custom fields.
48+ * @return bool Whether all custom tables exist or not.
5149 */
5250 public function all_tables_exist ( $ group = null ) {
5351 $ table_schemas = $ this ->get_registered_table_schemas ();
@@ -64,7 +62,6 @@ public function all_tables_exist( $group = null ) {
6462 $ result = $ this ->db ::get_col ( 'SHOW TABLES ' );
6563 foreach ( $ table_schemas as $ table_schema ) {
6664 if ( ! in_array ( $ table_schema ::table_name (), $ result , true ) ) {
67-
6865 return false ;
6966 }
7067 }
@@ -108,35 +105,6 @@ public function down() {
108105 * @since 1.0.0
109106 */
110107 do_action ( 'stellarwp_post_drop_tables ' );
111-
112- /**
113- * Runs before the custom fields are dropped.
114- *
115- * @since 1.0.0
116- */
117- do_action ( 'stellarwp_pre_drop_fields ' );
118-
119- $ field_schemas = $ this ->get_registered_field_schemas ();
120-
121- /**
122- * Filters the fields to be dropped.
123- *
124- * @since 1.0.0
125- *
126- * @param \Iterator $field_classes A list of Field_Schema_Interface objects that will have their fields dropped.
127- */
128- $ field_schemas = apply_filters ( 'stellarwp_fields_to_drop ' , $ field_schemas );
129-
130- foreach ( $ field_schemas as $ field_schema ) {
131- $ field_schema ->drop ();
132- }
133-
134- /**
135- * Runs after the custom tables have been dropped by The Events Calendar.
136- *
137- * @since 1.0.0
138- */
139- do_action ( 'stellarwp_post_drop_fields ' );
140108 }
141109
142110 /**
@@ -153,17 +121,6 @@ public function empty_custom_tables() {
153121 }
154122 }
155123
156- /**
157- * Get the registered field handlers.
158- *
159- * @since 1.0.0
160- *
161- * @return Fields\Collection
162- */
163- public function get_registered_field_schemas (): Fields \Collection {
164- return $ this ->container ->get ( Fields \Collection::class );
165- }
166-
167124 /**
168125 * Get the md5 hash of all the registered schemas classes with their versions.
169126 *
0 commit comments