MCPcopy Create free account
hub / github.com/asternic/wuzapi / addColumnIfNotExistsSQLite

Function addColumnIfNotExistsSQLite

migrations.go:661–679  ·  view source on GitHub ↗
(tx *sqlx.Tx, tableName, columnName, columnDef string)

Source from the content-addressed store, hash-verified

659
660 if currentType != "INTEGER" {
661 // No migration needed
662 return nil
663 }
664
665 // 2. Create new table with string ID
666 _, err = tx.Exec(`
667 CREATE TABLE users_new (
668 id TEXT PRIMARY KEY,
669 name TEXT NOT NULL,
670 token TEXT NOT NULL,
671 webhook TEXT NOT NULL DEFAULT '',
672 jid TEXT NOT NULL DEFAULT '',
673 qrcode TEXT NOT NULL DEFAULT '',
674 connected INTEGER,
675 expiration INTEGER,
676 events TEXT NOT NULL DEFAULT '',
677 proxy_url TEXT DEFAULT ''
678 )`)
679 if err != nil {
680 return fmt.Errorf("failed to create new table: %w", err)
681 }
682

Callers 1

applyMigrationFunction · 0.85

Calls 1

GetMethod · 0.80

Tested by

no test coverage detected