Welcome Guest, Not a member yet? Register   Sign In
which DB columns are autoincrement
#5

My apologies, it is evident that I must not have understood clearly what you want, because the optimization of any column of a table is as much possible in its creation as it is already in use.
Likewise, the database-agnostic quote left me somewhat confused. What exactly is a database-agnostic?

Dear @paliz, I'm talking about MySql and/or Mariadb. If you don't define that any column field is not autoincrement it will not be! I'm not required to have an "id" field, it could be eg name_id.
Code:
CREATE TABLE songs (
  id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
  album_id int UNSIGNED NOT NULL,
  name_id int UNSIGNED NOT NULL,
  disc int(10) DEFAULT '1' NULL,
  performer VARCHAR(128) COLLATE utf8mb4_swedish_ci NULL,
  composer VARCHAR(128) COLLATE utf8mb4_swedish_ci NULL,
  trk int(3) DEFAULT '1' NOT NULL,
  hint int(3) DEFAULT '0' NULL,
  song VARCHAR(128) COLLATE utf8mb4_swedish_ci NOT NULL,
  time VARCHAR(10) NOT NULL,
  created_at DATETIME NULL DEFAULT CURRENT_TIMESTAMP,
  update_at DATETIME on update CURRENT_TIMESTAMP NULL DEFAULT NULL
) ENGINE = InnoDB;
Reply


Messages In This Thread
which DB columns are autoincrement - by lukmim - 09-14-2021, 03:15 AM
RE: which DB columns are autoincrement - by wdeda - 09-14-2021, 05:50 AM
RE: which DB columns are autoincrement - by paliz - 09-14-2021, 10:03 AM
RE: which DB columns are autoincrement - by wdeda - 09-14-2021, 05:13 PM
RE: which DB columns are autoincrement - by wdeda - 09-17-2021, 06:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB