Get table column names on Drupal 8
To get database table columns names of a mysql database you can use "DESCRIBE my_table;" method.
To get database table columns names of a mysql database you can use "DESCRIBE my_table;" method.
To update a table you must create a custom module. Example , Here we use mymodule.
Example:
$schema = \Drupal\Core\Database\Database::getConnection()->schema();
(BaseFieldDefinition::create types)
Repair all tablesmysqlcheck -u root -p --auto-repair --check --all-databases
Repair a databasemysqlcheck -u root -p --repair --databases databasesname
Check a databasemysqlcheck -u root -p --databases databasesname
If there no data, You can use field_update_field (tested on D7) Like:
Show all columns of a table.
Syntax: SHOW COLUMNS FROM the_table_name;
Example: Show all columns of the mysql user table.mysql> SHOW COLUMNS FROM mysql.user;
drush cr
drush sql-dump > /pathto/mysql-dump-drupal8.sql
drush sql-drop
drush sql-cli
mysql> source /pathto/mysql-dump-drupal8.sql
1. KEY
2. TARGET
3. DATA
Example:
$databases[KEY][TARGET] = array (
DATA
);
Like: