Skip to content

Commit f3383bb

Browse files
authored
Add crdb v23 (#29)
* Add crdb v23 * deprecate old crdb versions * update composer keywords * fix database script for Crdb v23
1 parent 724d2cf commit f3383bb

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
os: [ ubuntu-latest ]
1818
php: [ 8.0, 8.1, 8.2 ]
1919
laravel: [ 10.*, 9.*, 8.* ]
20-
cockroachdb: [ v21.2.15, v22.1.12 ]
20+
cockroachdb: [ v22.2.17, v23.1.13 ]
2121
dependencies: [ stable, lowest ]
2222
include:
2323
- laravel: 10.*

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"keywords": [
55
"ylsideas",
66
"laravel",
7-
"cockroachdb-laravel"
7+
"cockroachdb-laravel",
8+
"cockroachdb"
89
],
910
"homepage": "https://github.com/ylsideas/cockroachdb-laravel",
1011
"license": "MIT",

database.php

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,24 @@
2222
CREATE DATABASE forge;
2323
CREATE USER forge;
2424
GRANT ALL PRIVILEGES ON DATABASE forge TO forge;
25-
26-
SET CLUSTER SETTING kv.raft_log.disable_synchronization_unsafe = true;
27-
SET CLUSTER SETTING kv.range_merge.queue_interval = '50ms';
28-
SET CLUSTER SETTING jobs.registry.interval.gc = '30s';
29-
SET CLUSTER SETTING jobs.registry.interval.cancel = '180s';
30-
SET CLUSTER SETTING jobs.retention_time = '15s';
31-
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
32-
SET CLUSTER SETTING kv.range_split.by_load_merge_delay = '5s';
33-
ALTER RANGE default CONFIGURE ZONE USING "gc.ttlseconds" = 5;
34-
ALTER DATABASE system CONFIGURE ZONE USING "gc.ttlseconds" = 5;
3525
heredoc);
26+
27+
$statements = [
28+
'SET CLUSTER SETTING kv.raft_log.disable_synchronization_unsafe = true;',
29+
'SET CLUSTER SETTING kv.range_merge.queue_interval = \'50ms\';',
30+
'SET CLUSTER SETTING jobs.registry.interval.gc = \'30s\';',
31+
'SET CLUSTER SETTING jobs.registry.interval.cancel = \'180s\';',
32+
'SET CLUSTER SETTING jobs.retention_time = \'15s\';',
33+
'SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;',
34+
'SET CLUSTER SETTING kv.range_split.by_load_merge_delay = \'5s\';',
35+
'ALTER RANGE default CONFIGURE ZONE USING "gc.ttlseconds" = 5;',
36+
'ALTER DATABASE system CONFIGURE ZONE USING "gc.ttlseconds" = 5;',
37+
];
38+
39+
foreach ($statements as $statement) {
40+
$pdo->exec($statement);
41+
}
42+
3643
} catch (PDOException $exception) {
3744
exit('Failed to creating database: ' . $exception->getMessage() . PHP_EOL);
3845
}

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3'
22
services:
33
crdb:
4-
image: "cockroachdb/cockroach:${VERSION:-v21.2.15}"
4+
image: "cockroachdb/cockroach:${VERSION:-v23.1.13}"
55
ports:
66
- "26257:26257"
77
- "8080:8080"

0 commit comments

Comments
 (0)