-- 1. Buat tabel baru dengan urutan kolom yang diinginkan
CREATE TABLE user_logs_new (
                               id UUID PRIMARY KEY,
                               user_id UUID NOT NULL,
                               last_signin timestamp NOT NULL
);

-- 2. Salin data dari tabel lama (yang sudah dikonversi ke UUID)
INSERT INTO user_logs_new (id, user_id, last_signin)
SELECT id::UUID, user_id::UUID, last_signin
FROM user_logs;

-- 3. Hapus tabel lama
DROP TABLE user_logs;

-- 4. Rename tabel baru ke nama asli
ALTER TABLE user_logs_new RENAME TO user_logs;