Skip to content

Commit 86499f6

Browse files
authored
Merge pull request #373 from CakeDC/master
add another use case
2 parents 7c10026 + 8cac249 commit 86499f6

File tree

6 files changed

+63
-0
lines changed

6 files changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
use Migrations\AbstractMigration;
5+
6+
class AddPgeDigitalProject extends AbstractMigration
7+
{
8+
/**
9+
* up method.
10+
*
11+
* @return void
12+
*/
13+
public function up()
14+
{
15+
$this->table('projects')->insert([
16+
'title' => 'PGE Digital',
17+
'website' => 'https://pge.rj.gov.br',
18+
'slug' => 'pge-digital',
19+
'technologies' => '',
20+
'brief_description' => 'PGE Digital is a complete solution for Brazilian Public Advocacy developed by PGE-RJ',
21+
'description' => '<p><strong>PGE Digital</strong> is a complete solution for Brazilian Public Advocacy developed by PGE-RJ.</p> <p>It provides all the necessary resources for Attorneys to act: from receiving subpoenas to managing deadlines and filing petitions.</p>',
22+
'is_highlighted' => 1,
23+
'is_showcase' => 1,
24+
'created' => date('Y-m-d H:i:s'),
25+
'modified' => date('Y-m-d H:i:s'),
26+
])->save();
27+
28+
$result = $this->fetchRow("SELECT id FROM projects WHERE title like 'PGE Digital'");
29+
$result['id'];
30+
31+
$this->table('uploaded_files')->insert([
32+
'file' => 'pge-digital.png',
33+
'dir' => 'webroot/files/PerspectiveImages/file/1700846962.8208',
34+
'size' => '183957',
35+
'type' => 'image/png',
36+
'created' => date('Y-m-d H:i:s'),
37+
'modified' => date('Y-m-d H:i:s'),
38+
'entity_id' => $result['id'],
39+
'model' => 'PerspectiveImages',
40+
])->save();
41+
$this->table('uploaded_files')->insert([
42+
'file' => 'pge-digital.png',
43+
'dir' => 'webroot/files/ScreenMonitorImages/file/1700846962.8224',
44+
'size' => '183957',
45+
'type' => 'image/png',
46+
'created' => date('Y-m-d H:i:s'),
47+
'modified' => date('Y-m-d H:i:s'),
48+
'entity_id' => $result['id'],
49+
'model' => 'ScreenMonitorImages',
50+
])->save();
51+
}
52+
53+
/**
54+
* down method.
55+
*
56+
* @return void
57+
*/
58+
public function down()
59+
{
60+
$this->query("DELETE FROM uploaded_files WHERE file like 'pge-digital.png'");
61+
$this->query("DELETE FROM projects WHERE title like 'PGE Digital'");
62+
}
63+
}
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)