Skip to content

Commit 9303ec0

Browse files
committed
Correct the SQLite schema for the exports table
1 parent 90e2e45 commit 9303ec0

File tree

6 files changed

+76
-2
lines changed

6 files changed

+76
-2
lines changed

CHANGELOG.markdown

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ but not every minor bugfix.
66

77
The goatcounter.com service generally runs the latest master.
88

9+
2020-11-10, v1.4.2
10+
------------------
11+
12+
- Add a "visitor counter" image you can add to your website to display the
13+
number of visitors, similar to old-style counters back in the ’90s (#398).
14+
15+
- Other than this, it's mostly contains a few minor bugfixes and the like. You
16+
can see a list of changes in the git log:
17+
https://github.com/zgoat/goatcounter/compare/v1.4.1...v1.4.2
18+
19+
920
2020-09-04 v1.4.1
1021
-----------------
1122

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
begin;
2+
create table exports2 (
3+
export_id integer primary key autoincrement,
4+
site_id integer not null,
5+
start_from_hit_id integer not null,
6+
7+
path varchar not null,
8+
created_at timestamp not null check(created_at = strftime('%Y-%m-%d %H:%M:%S', created_at)),
9+
10+
finished_at timestamp check(finished_at is null or finished_at = strftime('%Y-%m-%d %H:%M:%S', finished_at)),
11+
last_hit_id integer,
12+
num_rows integer,
13+
size varchar,
14+
hash varchar,
15+
error varchar,
16+
17+
foreign key (site_id) references sites(id) on delete restrict on update restrict
18+
);
19+
insert into exports2
20+
select export_id, site_id, start_from_hit_id, path, created_at, finished_at, last_hit_id, num_rows, size, hash, error from exports;
21+
drop table exports;
22+
alter table exports2 rename to exports;
23+
create index "exports#site_id#created_at" on exports(site_id, created_at);
24+
25+
insert into version values('2020-11-10-1-correct-exports');
26+
commit;

db/schema.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ create table exports (
486486
path varchar not null,
487487
created_at timestamp not null check(created_at = strftime('%Y-%m-%d %H:%M:%S', created_at)),
488488

489-
finished_at timestamp check(finished_at is null or finished_at = strftime('%Y-%m-%d %H:%M:%S', created_at)),
489+
finished_at timestamp check(finished_at is null or finished_at = strftime('%Y-%m-%d %H:%M:%S', finished_at)),
490490
last_hit_id integer,
491491
num_rows integer,
492492
size varchar,

pack/pack.go

Lines changed: 33 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tpl/api.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,8 @@ <h3 id="goatcounter.SiteSettings">goatcounter.SiteSettings <a class="permalink"
515515
<p class="info"></p>
516516
<h4>public <sup>boolean</sup></h4>
517517
<p></p>
518+
<h4>allow_counter <sup>boolean</sup></h4>
519+
<p></p>
518520
<h4>twenty_four_hours <sup>boolean</sup></h4>
519521
<p></p>
520522
<h4>sunday_starts_week <sup>boolean</sup></h4>

tpl/api.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,9 @@
593593
"allow_admin": {
594594
"type": "boolean"
595595
},
596+
"allow_counter": {
597+
"type": "boolean"
598+
},
596599
"campaigns": {
597600
"type": "array",
598601
"items": {

0 commit comments

Comments
 (0)