Skip to content

Commit 2b25933

Browse files
authoredApr 4, 2024
Merge pull request #376 from CakeDC/master
Add Science Operation Centers Project
2 parents bc0ce2b + 65cc077 commit 2b25933

File tree

6 files changed

+62
-0
lines changed

6 files changed

+62
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
use Migrations\AbstractMigration;
5+
6+
class AddScienceOperationCentersProject extends AbstractMigration
7+
{
8+
/**
9+
* up method.
10+
*
11+
* @return void
12+
*/
13+
public function up()
14+
{
15+
$this->table('projects')->insert([
16+
'title' => 'Science Operation Centers',
17+
'website' => 'https://cusp.space.swri.edu',
18+
'slug' => 'cusp-space',
19+
'technologies' => '',
20+
'brief_description' => "CakePHP enables Southwest Research Institute's SODAS team to create modular, full-stack, interactive web-apps",
21+
'description' => "<p><strong>CakePHP</strong> enables Southwest Research Institute's SODAS team to create modular, full-stack, interactive web-apps so the scientists and engineers working on over 50+ spacecraft and instruments can see the data most relevant to them, on demand.</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 'Science Operation Centers'");
29+
30+
$this->table('uploaded_files')->insert([
31+
'file' => 'science-operation-centers.png',
32+
'dir' => 'webroot/files/PerspectiveImages/file/1712164462.6238',
33+
'size' => '1444462',
34+
'type' => 'image/png',
35+
'created' => date('Y-m-d H:i:s'),
36+
'modified' => date('Y-m-d H:i:s'),
37+
'entity_id' => $result['id'],
38+
'model' => 'PerspectiveImages',
39+
])->save();
40+
$this->table('uploaded_files')->insert([
41+
'file' => 'science-operation-centers.png',
42+
'dir' => 'webroot/files/ScreenMonitorImages/file/1712164462.6351',
43+
'size' => '1444462',
44+
'type' => 'image/png',
45+
'created' => date('Y-m-d H:i:s'),
46+
'modified' => date('Y-m-d H:i:s'),
47+
'entity_id' => $result['id'],
48+
'model' => 'ScreenMonitorImages',
49+
])->save();
50+
}
51+
52+
/**
53+
* down method.
54+
*
55+
* @return void
56+
*/
57+
public function down()
58+
{
59+
$this->query("DELETE FROM uploaded_files WHERE file like 'science-operation-centers.png'");
60+
$this->query("DELETE FROM projects WHERE title like 'Science Operation Centers'");
61+
}
62+
}
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)