(MySQL) Add column if not exists?
#5

I would highly recommend using MariaDB instead of MySQL if you're able to, it works exactly the same but has more features and I believe has slightly better performance by default as well (and most importantly, works with the MySQL plugin).

In MariaDB doing this is as simple as
Код:
ALTER TABLE table_name ADD COLUMN IF NOT EXISTS column_name tinyint(1) DEFAULT 0;
Reply


Messages In This Thread
(MySQL) Add column if not exists? - by ByMatt20030 - 29.10.2018, 22:30
Re: (MySQL) Add column if not exists? - by TheToretto - 29.10.2018, 22:43
Re: (MySQL) Add column if not exists? - by ByMatt20030 - 29.10.2018, 23:01
Re: (MySQL) Add column if not exists? - by Jefff - 30.10.2018, 00:08
Re: (MySQL) Add column if not exists? - by corne - 30.10.2018, 07:07
Re: (MySQL) Add column if not exists? - by TheToretto - 30.10.2018, 07:22
Re: (MySQL) Add column if not exists? - by ByMatt20030 - 30.10.2018, 16:41

Forum Jump:


Users browsing this thread: 1 Guest(s)