-- Date :- 27-08-2025
ALTER TABLE users
ADD COLUMN app_token LONGTEXT NULL;

-- Date :- 29-08-2025
ALTER TABLE categories 
ADD COLUMN external_id INT NULL AFTER id;

ALTER TABLE categories 
ADD COLUMN store_alias VARCHAR(225) NULL;

ALTER TABLE users
ADD COLUMN app_access_token LONGTEXT NULL;

ALTER TABLE users
ADD COLUMN is_synced BOOLEAN DEFAULT FALSE;

ALTER TABLE products
MODIFY COLUMN currency VARCHAR(225) NULL;

-- Date :- 30-08-2025
ALTER TABLE categories
ADD user_id INTEGER,
ADD CONSTRAINT fk_categories_user
FOREIGN KEY (user_id) REFERENCES users(id);

ALTER TABLE products
ADD user_id INTEGER,
ADD CONSTRAINT fk_products_user
FOREIGN KEY (user_id) REFERENCES users(id);

ALTER TABLE categories 
ADD store_id INT NOT NULL,
ADD CONSTRAINT fk_categories_store FOREIGN KEY (store_id) REFERENCES stores(id);

ALTER TABLE products 
ADD store_id INT NOT NULL,
ADD CONSTRAINT fk_products_store FOREIGN KEY (store_id) REFERENCES stores(id);