Skip to content

Commit

Permalink
Merge pull request #55 from sciencemesh/owncloud-dev
Browse files Browse the repository at this point in the history
[ownCloud]: Progress towards milestone 0.6.0
  • Loading branch information
MahdiBaghbani authored Feb 25, 2024
2 parents bde067f + 112f91f commit f219daf
Show file tree
Hide file tree
Showing 56 changed files with 4,672 additions and 5,999 deletions.
2 changes: 0 additions & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@

tasks:
- init: make


4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ source:
appstore:
rm -rf $(appstore_build_directory)
mkdir -p $(appstore_build_directory)
tar cvzf $(appstore_package_name).tar.gz ../$(app_name)
tar cvzf $(appstore_package_name).tar.gz ../$(app_name)
--exclude="../$(app_name)/build" \
--exclude="../$(app_name)/tests" \
--exclude="../$(app_name)/Makefile" \
Expand All @@ -156,7 +156,7 @@ appstore:
--exclude="../$(app_name)/.*" \
--exclude="../$(app_name)/js/.*" \
--exclude-vcs \

.PHONY: coverage
coverage:
XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-text
Expand Down
191 changes: 191 additions & 0 deletions appinfo/Migrations/Version20230916.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
<?php
/**
* ownCloud - sciencemesh
*
* This file is licensed under the MIT License. See the LICENCE file.
* @license MIT
* @copyright Sciencemesh 2020 - 2023
*
* @author Mohammad Mahdi Baghbani Pourvahid <mahdi-baghbani@azadehafzar.ir>
*/

namespace OCA\ScienceMesh\Migrations;

use Doctrine\DBAL\Schema\Schema;
use OCP\Migration\ISchemaMigration;

/** Creates initial schema */
class Version20230916 implements ISchemaMigration
{
public function changeSchema(Schema $schema, array $options)
{
$prefix = $options["tablePrefix"];

// ocm_received_shares table.
if (!$schema->hasTable("{$prefix}sciencemesh_ocm_received_shares")) {
$table = $schema->createTable("{$prefix}sciencemesh_ocm_received_shares");

$table->addColumn("id", "bigint", [
"autoincrement" => true,
"unsigned" => true,
"notnull" => true,
"length" => 11,
]);

$table->addColumn("share_external_id", "bigint", [
"unsigned" => false,
"notnull" => true,
"length" => 11,
]);

$table->addColumn("name", "string", [
"length" => 255,
"notnull" => true,
"comment" => "Original name on the remote server"
]);

$table->addColumn("share_with", "string", [
"length" => 255,
"notnull" => true,
]);

$table->addColumn("owner", "string", [
"length" => 255,
"notnull" => true,
]);

$table->addColumn("initiator", "string", [
"length" => 255,
"notnull" => true,
]);

$table->addColumn("ctime", "bigint", [
"unsigned" => false,
"notnull" => true,
"length" => 11,
]);

$table->addColumn("mtime", "bigint", [
"unsigned" => false,
"notnull" => true,
"length" => 11,
]);

$table->addColumn("expiration", "bigint", [
"unsigned" => false,
"notnull" => false,
"default" => null,
"length" => 11,
]);

$table->addColumn("remote_share_id", "string", [
"length" => 255,
"notnull" => false,
"default" => null,
"comment" => "share ID at the remote server"
]);

$table->setPrimaryKey(["id"]);

$table->addUniqueIndex(
["share_external_id"],
"sm_ocm_rx_ex_id_idx"
);
$table->addUniqueIndex(
["share_with"],
"sm_ocm_rx_sh_w_idx"
);
}

// ocm_protocol_transfer table.
if (!$schema->hasTable("{$prefix}sciencemesh_ocm_received_share_protocol_transfer")) {
$table = $schema->createTable("{$prefix}sciencemesh_ocm_received_share_protocol_transfer");

$table->addColumn("ocm_received_share_id", "bigint", [
"unsigned" => true,
"notnull" => true,
"length" => 11,
]);

$table->addColumn("source_uri", "string", [
"length" => 255,
"notnull" => true,
]);

$table->addColumn("shared_secret", "string", [
"length" => 255,
"notnull" => true,
]);

$table->addColumn("size", "bigint", [
"unsigned" => false,
"notnull" => true,
"length" => 11,
]);

$table->addUniqueIndex(
["ocm_received_share_id"],
"sm_ocm_rx_share_id_tx_idx"
);
}

// ocm_protocol_webapp table.
if (!$schema->hasTable("{$prefix}sciencemesh_ocm_received_share_protocol_webapp")) {
$table = $schema->createTable("{$prefix}sciencemesh_ocm_received_share_protocol_webapp");

$table->addColumn("ocm_received_share_id", "bigint", [
"unsigned" => true,
"notnull" => true,
"length" => 11,
]);

$table->addColumn("uri_template", "string", [
"length" => 255,
"notnull" => true,
]);

$table->addColumn("view_mode", "bigint", [
"unsigned" => false,
"notnull" => true,
"length" => 11,
]);

$table->addUniqueIndex(
["ocm_received_share_id"],
"sm_ocm_rx_share_id_app_idx"
);
}

// ocm_protocol_webdav table.
if (!$schema->hasTable("{$prefix}sciencemesh_ocm_received_share_protocol_webdav")) {
$table = $schema->createTable("{$prefix}sciencemesh_ocm_received_share_protocol_webdav");

$table->addColumn("ocm_received_share_id", "bigint", [
"unsigned" => true,
"notnull" => true,
"length" => 11,
]);

$table->addColumn("uri", "string", [
"length" => 255,
"notnull" => true,
]);

$table->addColumn("shared_secret", "string", [
"length" => 255,
"notnull" => true,
]);

$table->addColumn("permissions", "bigint", [
"unsigned" => false,
"notnull" => true,
"length" => 11,
]);

$table->addUniqueIndex(
["ocm_received_share_id"],
"sm_ocm_rx_share_id_dav_idx"
);
}
}
}
Loading

0 comments on commit f219daf

Please sign in to comment.