status-go/appdatabase/migrations/sql/1687249080_add_position_accounts.up..sql
2023-06-26 16:15:48 +02:00

5 lines
284 B
SQL

ALTER TABLE keypairs_accounts ADD COLUMN position INT NOT NULL DEFAULT 0;
UPDATE keypairs_accounts AS ka SET position = ka2.rowNumber FROM (
SELECT created_at, ROW_NUMBER() OVER (ORDER BY created_at) AS rowNumber FROM keypairs_accounts) AS ka2
WHERE ka.created_at = ka2.created_at;