/*
  Destructive reset: DROP and recreate dbo.user_profiling_tracker empty.

  Use only when you intentionally discard all last_completed_at checkpoints
  (e.g. local dev). For production schema changes with data kept, run
  recreate_user_profiling_tracker.sql instead.
*/

IF OBJECT_ID(N'dbo.user_profiling_tracker', N'U') IS NOT NULL
    DROP TABLE dbo.user_profiling_tracker;
GO

CREATE TABLE dbo.user_profiling_tracker (
    id BIGINT IDENTITY(1, 1) NOT NULL,
    user_id BIGINT NOT NULL,
    last_completed_at DATETIME2(7) NOT NULL,
    CONSTRAINT PK_user_profiling_tracker PRIMARY KEY (id),
    CONSTRAINT UQ_user_profiling_tracker_user_id UNIQUE (user_id)
);
GO
