summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-07-05 21:43:56 +0530
committersinanmohd <sinan@sinanmohd.com>2024-07-06 12:23:02 +0530
commit2f0483eb34ae51dc0dc241409342db021b995856 (patch)
tree0b3232d6881075fc75acb70482d7438eaba6a911 /db
parent4b44400700d0fb12cc7d86ecc020a30d78aa74c6 (diff)
bpf: use hwaddr for identification
Diffstat (limited to 'db')
-rw-r--r--db/models.go6
-rw-r--r--db/query.sql.go6
-rw-r--r--db/schema.sql6
3 files changed, 9 insertions, 9 deletions
diff --git a/db/models.go b/db/models.go
index 83e4051..a6da6bf 100644
--- a/db/models.go
+++ b/db/models.go
@@ -9,9 +9,9 @@ import (
)
type Usage struct {
- Hardwareaddr int32
+ Hardwareaddr int64
Starttime pgtype.Timestamp
Stoptime pgtype.Timestamp
- Egress int32
- Ingress int32
+ Egress int64
+ Ingress int64
}
diff --git a/db/query.sql.go b/db/query.sql.go
index de68384..7afe159 100644
--- a/db/query.sql.go
+++ b/db/query.sql.go
@@ -20,11 +20,11 @@ INSERT INTO Usage (
`
type EnterUsageParams struct {
- Hardwareaddr int32
+ Hardwareaddr int64
Starttime pgtype.Timestamp
Stoptime pgtype.Timestamp
- Egress int32
- Ingress int32
+ Egress int64
+ Ingress int64
}
func (q *Queries) EnterUsage(ctx context.Context, arg EnterUsageParams) error {
diff --git a/db/schema.sql b/db/schema.sql
index b8f8540..aece061 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -1,7 +1,7 @@
CREATE TABLE Usage (
- HardwareAddr INTEGER NOT NULL,
+ HardwareAddr BIGINT NOT NULL,
StartTime TIMESTAMP NOT NULL,
StopTime TIMESTAMP NOT NULL,
- Egress INTEGER NOT NULL,
- Ingress INTEGER NOT NULL
+ Egress BIGINT NOT NULL,
+ Ingress BIGINT NOT NULL
);