Documentation
¶
Index ¶
- type TimestampsMigration
- func (m *TimestampsMigration) Apply(ctx context.Context, plan *migratorredis.Plan) (*migratorredis.State, error)
- func (m *TimestampsMigration) AutoRunnable() bool
- func (m *TimestampsMigration) Cleanup(ctx context.Context, state *migratorredis.State) error
- func (m *TimestampsMigration) Description() string
- func (m *TimestampsMigration) IsApplicable(ctx context.Context) (bool, string)
- func (m *TimestampsMigration) Name() string
- func (m *TimestampsMigration) Plan(ctx context.Context) (*migratorredis.Plan, error)
- func (m *TimestampsMigration) PlanCleanup(ctx context.Context) (int, error)
- func (m *TimestampsMigration) Verify(ctx context.Context, state *migratorredis.State) (*migratorredis.VerificationResult, error)
- func (m *TimestampsMigration) Version() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TimestampsMigration ¶
type TimestampsMigration struct {
// contains filtered or unexported fields
}
TimestampsMigration converts timestamp fields (created_at, updated_at) from RFC3339 string format to Unix millisecond timestamps (int64) for timezone-agnostic sorting.
This migration handles both tenant and destination records. It is idempotent - records with numeric timestamps are skipped.
NOTE: disabled_at is intentionally NOT migrated here because:
- It's not indexed by RediSearch (not needed for sorting)
- Migrating it risks race conditions (user enables destination between Plan/Apply)
- Lazy migration handles it: reads accept both formats, and any disable/enable action will write the new Unix millisecond format automatically
func New ¶
func New(client redis.Client, logger migratorredis.Logger, deploymentID string) *TimestampsMigration
New creates a new TimestampsMigration instance. deploymentID is optional - pass empty string for single-tenant deployments.
func (*TimestampsMigration) Apply ¶
func (m *TimestampsMigration) Apply(ctx context.Context, plan *migratorredis.Plan) (*migratorredis.State, error)
func (*TimestampsMigration) AutoRunnable ¶
func (m *TimestampsMigration) AutoRunnable() bool
func (*TimestampsMigration) Cleanup ¶
func (m *TimestampsMigration) Cleanup(ctx context.Context, state *migratorredis.State) error
func (*TimestampsMigration) Description ¶
func (m *TimestampsMigration) Description() string
func (*TimestampsMigration) IsApplicable ¶
func (m *TimestampsMigration) IsApplicable(ctx context.Context) (bool, string)
func (*TimestampsMigration) Name ¶
func (m *TimestampsMigration) Name() string
func (*TimestampsMigration) Plan ¶
func (m *TimestampsMigration) Plan(ctx context.Context) (*migratorredis.Plan, error)
func (*TimestampsMigration) PlanCleanup ¶
func (m *TimestampsMigration) PlanCleanup(ctx context.Context) (int, error)
func (*TimestampsMigration) Verify ¶
func (m *TimestampsMigration) Verify(ctx context.Context, state *migratorredis.State) (*migratorredis.VerificationResult, error)
func (*TimestampsMigration) Version ¶
func (m *TimestampsMigration) Version() int
Click to show internal directories.
Click to hide internal directories.