1
0
mirror of https://github.com/flarum/core.git synced 2025-08-10 10:24:46 +02:00

feat: add support for SQLite (#3984)

* feat: add support for sqlite

* chore: add warning on install

* fix: ignore constraints before transaction begins

* chore: update workflow

* Apply fixes from StyleCI

* chore: generate sqlite dump and manually add foreign keys

* chore: fix actions

* chore: fix actions

* chore: fix actions

* chore: fix actions

* chore: fix actions

* chore: fix actions

* test: fix

* Apply fixes from StyleCI

* fix: sqlite with db prefix

* Apply fixes from StyleCI

* fix: statistics sqlite
This commit is contained in:
Sami Mazouz
2024-06-21 07:25:11 +01:00
committed by GitHub
parent 5ce1aeab47
commit eb6e599df1
61 changed files with 801 additions and 263 deletions

View File

@@ -15,8 +15,8 @@
<td>{{ $phpVersion }}</td>
</tr>
<tr>
<td>MySQL</td>
<td>{{ $mysqlVersion }}</td>
<td>{{ $dbDriver }}</td>
<td>{{ $dbVersion }}</td>
</tr>
</tbody>
</table>

View File

@@ -15,7 +15,7 @@
padding: 0;
line-height: 1.5;
}
body, input, button {
body, .FormControl, button {
font-family: 'Open Sans', sans-serif;
font-size: 16px;
color: #7E96B3;
@@ -50,15 +50,19 @@
.FormGroup {
margin-bottom: 20px;
}
.FormGroup .FormField:first-child input {
.FormGroup .FormField:first-child .FormControl {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.FormGroup .FormField:last-child input {
.FormGroup .FormField:last-child .FormControl {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
.FormField input {
.FormField select.FormControl {
-webkit-appearance: none;
-moz-appearance: none;
}
.FormField .FormControl {
background: #EDF2F7;
margin: 0 0 1px;
border: 2px solid transparent;
@@ -67,7 +71,7 @@
padding: 15px 15px 15px 180px;
box-sizing: border-box;
}
.FormField input:focus {
.FormField .FormControl:focus {
border-color: #e7652e;
background: #fff;
color: #444;
@@ -106,6 +110,17 @@
margin-bottom: 20px;
}
.Alert {
padding: 15px 20px;
border-radius: 4px;
margin-bottom: 20px;
}
.Alert--warning {
background: #fff2ae;
color: #ad6c00;
}
.animated {
-webkit-animation-fill-mode: both;
animation-fill-mode: both;

View File

@@ -8,56 +8,74 @@
<div class="FormGroup">
<div class="FormField">
<label>Forum Title</label>
<input name="forumTitle">
<input class="FormControl" name="forumTitle">
</div>
</div>
<div class="FormGroup">
<div data-group="sqlite" style="display:none">
<div class="Alert Alert--warning">
<strong>Warning:</strong> Please keep in mind that while Flarum supports SQLite, not all ecosystem extensions do. If you're planning to install extensions, you should expect some of them to not work properly or at all.
</div>
</div>
</div>
<div class="FormGroup">
<div class="FormField">
<label>MySQL Host</label>
<input name="mysqlHost" value="localhost">
<label>Database Driver</label>
<select class="FormControl" name="dbDriver">
<option value="mysql">MySQL</option>
<option value="sqlite">SQLite</option>
</select>
</div>
<div class="FormField">
<label>MySQL Database</label>
<input name="mysqlDatabase">
<label>Database</label>
<input class="FormControl" name="dbName" value="flarum">
</div>
<div class="FormField">
<label>MySQL Username</label>
<input name="mysqlUsername">
</div>
<div data-group="mysql">
<div class="FormField">
<label>MySQL Host</label>
<input class="FormControl" name="mysqlHost" value="localhost">
</div>
<div class="FormField">
<label>MySQL Password</label>
<input type="password" name="mysqlPassword">
<div class="FormField">
<label>MySQL Username</label>
<input class="FormControl" name="mysqlUsername">
</div>
<div class="FormField">
<label>MySQL Password</label>
<input class="FormControl" type="password" name="mysqlPassword">
</div>
</div>
<div class="FormField">
<label>Table Prefix</label>
<input type="text" name="tablePrefix">
<input class="FormControl" type="text" name="tablePrefix">
</div>
</div>
<div class="FormGroup">
<div class="FormField">
<label>Admin Username</label>
<input name="adminUsername">
<input class="FormControl" name="adminUsername">
</div>
<div class="FormField">
<label>Admin Email</label>
<input name="adminEmail">
<input class="FormControl" name="adminEmail">
</div>
<div class="FormField">
<label>Admin Password</label>
<input type="password" name="adminPassword">
<input class="FormControl" type="password" name="adminPassword">
</div>
<div class="FormField">
<label>Confirm Password</label>
<input type="password" name="adminPasswordConfirmation">
<input class="FormControl" type="password" name="adminPasswordConfirmation">
</div>
</div>
@@ -70,6 +88,18 @@
document.addEventListener('DOMContentLoaded', function() {
document.querySelector('form input').select();
document.querySelector('select[name="dbDriver"]').addEventListener('change', function() {
document.querySelectorAll('[data-group]').forEach(function(group) {
group.style.display = 'none';
});
const groups = document.querySelectorAll('[data-group="' + this.value + '"]');
groups.forEach(function(group) {
group.style.display = 'block';
});
});
document.querySelector('form').addEventListener('submit', function(e) {
e.preventDefault();

View File

@@ -8,7 +8,7 @@
<div class="FormGroup">
<div class="FormField">
<label>Database Password</label>
<input type="password" name="databasePassword">
<input class="FormControl" type="password" name="databasePassword">
</div>
</div>