Fixed missing example in commands
This commit is contained in:
parent
6c38d803bc
commit
04a22e5995
2 changed files with 51 additions and 0 deletions
49
src/EllieBot/clean-migrations.ps1
Normal file
49
src/EllieBot/clean-migrations.ps1
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
# WORK IN PROGRESS
|
||||||
|
|
||||||
|
# Define the folders to search for designer.cs files
|
||||||
|
$folders = @("Migrations/PostgreSql", "Migrations/Sqlite")
|
||||||
|
|
||||||
|
# Loop through each folder
|
||||||
|
foreach ($folder in $folders) {
|
||||||
|
# Get all designer.cs files in the folder and subfolders
|
||||||
|
$files = Get-ChildItem -Path $folder -Filter *.designer.cs -Recurse
|
||||||
|
|
||||||
|
$excludedPattern = "cleanup|mysql-init|squash|rero-cascade"
|
||||||
|
|
||||||
|
$filteredFiles = $files | Where-Object { $_.Name -notmatch $excludedPattern }
|
||||||
|
# Loop through each file
|
||||||
|
foreach ($file in ($files | Where-Object { $_.Name -notmatch $excludedPattern })) {
|
||||||
|
# Read the contents of the file
|
||||||
|
$content = Get-Content -Path $file.FullName | Select-Object -First 30
|
||||||
|
|
||||||
|
# Find the attribute lines
|
||||||
|
$attributes = $content | Where-Object { $_ -match '\[.*\]' } | ForEach-Object { ' ' + $_.Trim() }
|
||||||
|
|
||||||
|
# Find the namespace
|
||||||
|
$namespace = $content | Where-Object { $_ -match 'namespace' } | ForEach-Object { $_.Split(' ')[1] }
|
||||||
|
|
||||||
|
# Find the class name
|
||||||
|
$class_name = $content | Where-Object { $_ -match 'partial class' } | ForEach-Object { $_.Trim().Split(' ')[2] }
|
||||||
|
|
||||||
|
# Replace the contents with the new template
|
||||||
|
$new_content = @"
|
||||||
|
// <auto-generated />
|
||||||
|
using EllieBot.Db;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace $namespace
|
||||||
|
{
|
||||||
|
$($attributes -join "`n")
|
||||||
|
partial class $class_name
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"@
|
||||||
|
|
||||||
|
# Write the new contents to the file
|
||||||
|
Set-Content -Path $file.FullName -Value $new_content
|
||||||
|
}
|
||||||
|
}
|
|
@ -4668,5 +4668,7 @@ rakeback:
|
||||||
Rakeback is accumulated by betting (not by winning or losing).
|
Rakeback is accumulated by betting (not by winning or losing).
|
||||||
Default rakeback is 0.05 * house edge
|
Default rakeback is 0.05 * house edge
|
||||||
House edge is defined per game
|
House edge is defined per game
|
||||||
|
ex:
|
||||||
|
- ''
|
||||||
params:
|
params:
|
||||||
- {}
|
- {}
|
Loading…
Reference in a new issue